Post

Replies

Boosts

Views

Activity

Reply to How to use KTX file Image3D in ShaderGraph?
Also tried create 3D texture from PNG images and set parameter on ShaderGraphMaterial. But still not work. Image3D/Image3DPixel output always white, Image3DRead output always black. var images: [CGImage] = [] for i in 0..<32 { let image = UIImage(named: "\(i).png")!.cgImage! images.append(image) } let tex = try! await TextureResource.texture3D(slices: images, options: TextureResource.CreateOptions(semantic: .color)) let entity = scene.findEntity(named: "Slice")! var material = entity.components[ModelComponent.self]!.materials.first as! ShaderGraphMaterial try! material.setParameter(name: "Volume", value: .textureResource(tex)) So, likely the problem does not come from the KTX file, but Realitykit does not support Image3D yet?
Oct ’24
Reply to Bug? ImageFile in/out NodeGraph make ShaderGraph crash
It should be red output whatever ImageFile be set.
Replies
Boosts
Views
Activity
Nov ’24
Reply to How to use KTX file Image3D in ShaderGraph?
Temporarily solved by using TextureResource.init dimensions 3D with r16Float raw pixelFormat. Successfully set runtime dynamic volume texture parameter on ShaderGraphMaterial.
Replies
Boosts
Views
Activity
Oct ’24
Reply to How to use KTX file Image3D in ShaderGraph?
Also tried create 3D texture from PNG images and set parameter on ShaderGraphMaterial. But still not work. Image3D/Image3DPixel output always white, Image3DRead output always black. var images: [CGImage] = [] for i in 0..<32 { let image = UIImage(named: "\(i).png")!.cgImage! images.append(image) } let tex = try! await TextureResource.texture3D(slices: images, options: TextureResource.CreateOptions(semantic: .color)) let entity = scene.findEntity(named: "Slice")! var material = entity.components[ModelComponent.self]!.materials.first as! ShaderGraphMaterial try! material.setParameter(name: "Volume", value: .textureResource(tex)) So, likely the problem does not come from the KTX file, but Realitykit does not support Image3D yet?
Replies
Boosts
Views
Activity
Oct ’24
Reply to How to use KTX file Image3D in ShaderGraph?
Typo: for _ in range(1) should be for _ in range(size)
Replies
Boosts
Views
Activity
Oct ’24