Post

Replies

Boosts

Views

Activity

Reply to In SwiftUI on macOS, using instancing in RealityKit, how can I set individual colours per instance?
Sorry, the shader code is incorrect, here is the fixed version: [[stitchable]] void surfaceShaderWithCustomUniforms(realitykit::surface_parameters params, constant SurfaceCustomUniforms &customParams) { half red = ((customParams.argb >> 16) & 0xff) / 255.0h; half green = ((customParams.argb >> 8) & 0xff) / 255.0h; half blue = (customParams.argb & 0xff) / 255.0h; half3 color = { red, green, blue }; params.surface().set_base_color(color); }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
2d