Post

Replies

Boosts

Views

Activity

Reply to Having trouble with USD material not showing correct color
This is the definition of this asset per the framework from isaaclab mentioned in my response to your comment: red_block = RigidObjectCfg( prim_path="/World/envs/env_.*/Red_block", init_state=RigidObjectCfg.InitialStateCfg( pos=[-4.1, -4.08, 0.84], rot=[1, 0, 0, 0] ), spawn=sim_utils.CuboidCfg( size=(0.075, 0.075, 0.075), rigid_props=sim_utils.RigidBodyPropertiesCfg( disable_gravity=False, retain_accelerations=False ), mass_props=sim_utils.MassPropertiesCfg(mass=1.0), collision_props=sim_utils.CollisionPropertiesCfg( collision_enabled=True, contact_offset=0.01, rest_offset=0.0 ), visual_material=sim_utils.PreviewSurfaceCfg( diffuse_color=(1.0, 0.0, 0.0), metallic=0 ), physics_material=sim_utils.RigidBodyMaterialCfg( friction_combine_mode="max", restitution_combine_mode="min", static_friction=10, dynamic_friction=0.5, restitution=0.0, ), ), )
1w
Reply to Having trouble with USD material not showing correct color
This is the usda file for the asset. There is a diffuse color listed in the Shader but it appears RealityKit only registers the default color of (0.18, 0.18, 0.18) (from here https://openusd.org/dev/spec_usdpreviewsurface.html) ( defaultPrim = "Root" upAxis = "Z" ) def Xform "Root" { def Xform "Red_block" ( apiSchemas = ["PhysicsMassAPI", "PhysicsRigidBodyAPI", "PhysxRigidBodyAPI"] ) { float physics:mass = 1 bool physxRigidBody:disableGravity = 0 bool physxRigidBody:retainAccelerations = 0 token ui:displayGroup = "Material Graphs" token ui:displayName = "Red_block" int ui:order = 1024 float3 xformOp:rotateXYZ = (0, -0, 0) float3 xformOp:scale = (1, 1, 1) double3 xformOp:translate = (0, 0, 0) uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:rotateXYZ", "xformOp:scale"] def "geometry" { def Cube "mesh" ( apiSchemas = ["PhysicsCollisionAPI", "PhysxCollisionAPI", "MaterialBindingAPI"] ) { rel material:binding = </Root/Red_block/geometry/material> ( bindMaterialAs = "strongerThanDescendants" ) rel material:binding:physics = </Root/Red_block/geometry/material> ( bindMaterialAs = "strongerThanDescendants" ) bool physics:collisionEnabled = 1 float physxCollision:contactOffset = 0.01 float physxCollision:restOffset = 0 double size = 0.05 quatd xformOp:orient = (1, 0, 0, 0) double3 xformOp:scale = (1, 1, 1) double3 xformOp:translate = (0, 0, 0) uniform token[] xformOpOrder = ["xformOp:translate", "xformOp:orient", "xformOp:scale"] } def Material "material" ( apiSchemas = ["PhysicsMaterialAPI", "PhysxMaterialAPI"] ) { token outputs:displacement.connect = </Root/Red_block/geometry/material/Shader.outputs:displacement> token outputs:surface.connect = </Root/Red_block/geometry/material/Shader.outputs:surface> float physics:dynamicFriction = 0.5 float physics:restitution = 0 float physics:staticFriction = 10 float physxMaterial:compliantContactDamping = 0 float physxMaterial:compliantContactStiffness = 0 uniform token physxMaterial:frictionCombineMode = "max" uniform token physxMaterial:restitutionCombineMode = "min" def Shader "Shader" { uniform token info:id = "UsdPreviewSurface" float3 inputs:diffuseColor = (1, 0, 0) float3 inputs:emissiveColor = (0, 0, 0) int inputs:metallic = 0 float inputs:opacity = 1 float inputs:roughness = 0.5 token outputs:displacement token outputs:surface } } } } }
1w
Reply to How to visualize a point cloud in RealityKit on visionOS?
To anyone who finds themselves here, the point topology of LowLevelMesh does not work well on the actual device (although it appears fine in simulator) You can see for yourself by downloading the following code (https://developer.apple.com/documentation/realitykit/generating-interactive-geometry-with-realitykit) and changing the topology from .triangle to .point in the initializeMeshParts function in PlaneMesh.swift. I still ended up using a LowLevelMesh but it works better as .triangle and you can make a compute shader function that expands a single point into three vertexes for rendering the triangle. Much more performant.
Topic: Spatial Computing SubTopic: General Tags:
Sep ’25
Reply to How to visualize a point cloud in RealityKit on visionOS?
I attempted to use a LowLevelMesh and I referenced this sample.. I tried to change the .topology of the LowLevelMesh.Partin the initializeMeshParts function to .point. Referencing the documentation for MTLPrimitiveType.point states that "The vertex shader must provide [[point_size]], or the point size is undefined." However, in this sample, the vertex shader function is not defined. What would be the best way to implement this simply?
Topic: Spatial Computing SubTopic: General Tags:
Jul ’25
Reply to Using a WKWebView inside RealityView attachment causes crashes.
Not sure what is different, but I can now interact with it: struct ImmersiveView: View { @Environment(AppModel.self) private var appModel var body: some View { RealityView { content, attachments in let anchor = AnchorEntity(AnchoringComponent.Target.head) if let sceneAttachment = attachments.entity(for: "test") { sceneAttachment.position = SIMD3<Float>(0,0,-3.5) anchor.addChild(sceneAttachment) } content.add(anchor) } attachments: { Attachment(id: "test") { WebViewWrapper(webView: WKWebView()) } } } } @MainActor @Observable class AppModel { let immersiveSpaceID = "ImmersiveSpace" enum ImmersiveSpaceState { case closed case inTransition case open } var immersiveSpaceState = ImmersiveSpaceState.closed } struct WebViewWrapper: UIViewRepresentable { let webView: WKWebView func makeUIView(context: Context) -> WKWebView { let url = URL(string: "http://apple.com") webView.load(URLRequest(url: url!)) return webView } func updateUIView(_ uiView: WKWebView, context: Context) { } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
May ’25