3D Graphics

RSS for tag

Discuss integrating three-dimensional graphics into your app.

Posts under 3D Graphics tag

95 Posts

Post

Replies

Boosts

Views

Activity

recovering the real size of a mesh created with photogrammetry using depth map and gravity vector.
So, I've modified the CaptureSample IOS app to take photos using the truedepth front camera. It worked perfectly, and I have TIF depth maps together with the gravity vector and the photos I took. Using the HelloPhotogrammetry command line, I created the meshes without any problems. I notice the meshes have a consistent size between then, for example, creating a mesh of my face and a mesh of my nose, the nose mesh fits perfectly on top of the nose on the face mesh! Great! BUT, when I open the meshes in Maya, for example, they are really really tiny! I was expecting to see the objects in the proper scale, and hopefully bee able to even take measurements in maya to see if they would match the real measurements of the scanned object, but they don't seem to come on the right size at all. I tried set Maya to meters, centimetres and milimetres, but it always imports the meshes really tiny. I have to apply a scale of 100 to be able to see the meshes. But then they don't measure correctly. By try and error, I was able to find that scaling the meshes by 86 would make then match the real world scale in centimetres. Is there a proper space conversion that needs to be applied to the mesh to convert it to the real world scale? Would the problem be that I'm using the truedepth camera instead of the back camera, and the depth map value is coming in a different scale than what HelloPhotogrammetry expects?
3
0
2.7k
Mar ’22
Scene kit View as Sub view
I'm trying to populate scene view inside Table cell (for 3D objects) as a subview. For first view load its working fine but as new child nodes are added/Updated to view that is not happening its remain static(objects are not updating on view). Tried with renderer delegate values of child nodes are updated but on view its not happening we have to switch between different scene then view is loaded properly. How to update or refresh subview continuously ?
1
0
1.6k
Mar ’22
Pass animatable custom parameters to metal shader in RealityKit 2
Hi, In SceneKit I pass custom parameters to a metal shader using a SCNAnimation, for example: let revealAnimation = CABasicAnimation(keyPath: "revealage") revealAnimation.duration =  duration revealAnimation.toValue = toValue let scnRevealAnimation = SCNAnimation(caAnimation: revealAnimation) material.addAnimation(scnRevealAnimation, forKey: "Reveal") How would I do similar to a metal shader in RealityKit? I saw in the Octopus example: //int(params.uniforms().custom_parameter()[0]) But it's commented out and there is no example how to set the custom variable and animate it? (unless I missed it) Great session BTW Thanks
2
0
2.3k
Mar ’22
Photo Catch to Cinema4D via OBJ
Total newbie here. And I recognize that this isn't strictly a developer question. But it is where Photo Capture lead me. So... We're having trouble with the OBJ files generated by Photo Catch being recognized by Cinema4D. Is anyone having thew same issue? There's not a lot to adjust in Photo Catch so I'm not entirely sure where we would go wrong here. If this isn't the right place for these questions. can you steer me to where I should go? Much obliged!
0
0
666
Feb ’22
MTLDebugCommandBuffer lockPurgeableObjects
I'm using Xcode 13 after recently updating to MacOS Monterey, and only after updating am I getting this error: [MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x14a8a8cc0 (label: null), referenced in cmd buffer 0x149091400 (label: null) is in volatile or empty purgeable state at commit' I haven't changed my code at all between updating to the latest OS, and it worked perfectly before. How can I fix this? I don't think there should be any reason that I can't use a command buffer on a texture resource with a volatile/empty purgeable state.
4
0
4.1k
Jan ’22
MTLDevice.currentAllocatedSize incorrect on late 2014 iMacs
I have two iMacs where MTLDevice.currentAllocatedSize is acting strange--the reported size keeps rising, despite periodically freeing resources to keep under MTLDevice.recommendedMaxWorkingSetSize. The affected iMacs are both late 2014 models running MacOS Big Sur 11.6, one with an AMD Radeon R9 M290X and the other with an AMD Radeon R9 M295X. So far none of our other Macs have shown this behaviour, which suggests this may be an API or driver problem. I do have the option of using my own resource size estimates, but that's likely not as accurate as what the system reports, assuming MTLDevice.currentAllocatedSize is working properly. Any suggestions?
2
0
1.9k
Dec ’21
Error while converting MTLTexture to CVPixelBuffer
I am getting an error from the graphics driver while converting the EnvironmentTexture(from ARKIT.AREnvironmentProbeAnchor) to CVPixelBuffer. The EnvironmentTexture is an IMTLTexture. I am using Xamarin.iOS. This is the code that I use to convert the IMTLTexture to CVPixelBuffer. buffers[i] = new CVPixelBuffer((nint)epAnchor.EnvironmentTexture.Width, (nint)epAnchor.EnvironmentTexture.Height, CVPixelFormatType.CV32RGBA); GetEnvironmentTextureSlice(buffers[i], epAnchor.EnvironmentTexture, i); public void GetEnvironmentTextureSlice(CVPixelBuffer pixelBuffer, Metal.IMTLTexture texture, int id) { Metal.MTLRegion mtlRegion = Metal.MTLRegion.Create2D((nuint)0, 0, 256, 256); nuint bytesPerPixel = 4; nuint bytesPerRow = bytesPerPixel * (nuint)mtlRegion.Size.Width; // (nuint)pixelBuffer.BytesPerRow; nuint bytesPerImage = bytesPerRow * (nuint)mtlRegion.Size.Height; pixelBuffer.Lock(CVPixelBufferLock.None); texture.GetBytes(pixelBuffer.BaseAddress, (nuint)pixelBuffer.BytesPerRow, mtlRegion, 0); pixelBuffer.Unlock(CVPixelBufferLock.None); } The error I am getting from the driver is AGX: Texture read/write assertion failed: bytes_per_row = used_bytes_per_row I tried with different values of pixelBuffer.BytesPerRow but still getting the error. Can someone help me?
1
0
2.7k
Dec ’21
vkCmdDrawIndexedIndirectCount functionality under Metal
Hello, It looks like my previous question was closed without being resolved. https://developer.apple.com/forums/thread/668171 There are FPS values from our new benchmark. Indirect command buffers are not working properly. So there is no way to emulate multi-draw indirect count functionality other than a loop of draw indirect commands. As you can see below, the same hardware is working three times slower under Metal because of it. And Apple M1 performance is worse than AMD integrated graphics performance. We have a buffer with multiple draw commands. How should we render it efficiently under Metal? AMD Vega 56 eGPU: Direct3D12: 94.0 Direct3D11: 87.2 Vulkan: 91.1 Metal: 35.8 AMD Ryzen™ 7 4800H: Direct3D12: 21.1 Direct3D11: 19.4 Vulkan: 20.5 Apple M1: Metal: 16.9 Thank you
9
0
3.7k
Nov ’21
recovering the real size of a mesh created with photogrammetry using depth map and gravity vector.
So, I've modified the CaptureSample IOS app to take photos using the truedepth front camera. It worked perfectly, and I have TIF depth maps together with the gravity vector and the photos I took. Using the HelloPhotogrammetry command line, I created the meshes without any problems. I notice the meshes have a consistent size between then, for example, creating a mesh of my face and a mesh of my nose, the nose mesh fits perfectly on top of the nose on the face mesh! Great! BUT, when I open the meshes in Maya, for example, they are really really tiny! I was expecting to see the objects in the proper scale, and hopefully bee able to even take measurements in maya to see if they would match the real measurements of the scanned object, but they don't seem to come on the right size at all. I tried set Maya to meters, centimetres and milimetres, but it always imports the meshes really tiny. I have to apply a scale of 100 to be able to see the meshes. But then they don't measure correctly. By try and error, I was able to find that scaling the meshes by 86 would make then match the real world scale in centimetres. Is there a proper space conversion that needs to be applied to the mesh to convert it to the real world scale? Would the problem be that I'm using the truedepth camera instead of the back camera, and the depth map value is coming in a different scale than what HelloPhotogrammetry expects?
Replies
3
Boosts
0
Views
2.7k
Activity
Mar ’22
Scene kit View as Sub view
I'm trying to populate scene view inside Table cell (for 3D objects) as a subview. For first view load its working fine but as new child nodes are added/Updated to view that is not happening its remain static(objects are not updating on view). Tried with renderer delegate values of child nodes are updated but on view its not happening we have to switch between different scene then view is loaded properly. How to update or refresh subview continuously ?
Replies
1
Boosts
0
Views
1.6k
Activity
Mar ’22
Pass animatable custom parameters to metal shader in RealityKit 2
Hi, In SceneKit I pass custom parameters to a metal shader using a SCNAnimation, for example: let revealAnimation = CABasicAnimation(keyPath: "revealage") revealAnimation.duration =  duration revealAnimation.toValue = toValue let scnRevealAnimation = SCNAnimation(caAnimation: revealAnimation) material.addAnimation(scnRevealAnimation, forKey: "Reveal") How would I do similar to a metal shader in RealityKit? I saw in the Octopus example: //int(params.uniforms().custom_parameter()[0]) But it's commented out and there is no example how to set the custom variable and animate it? (unless I missed it) Great session BTW Thanks
Replies
2
Boosts
0
Views
2.3k
Activity
Mar ’22
Photo Catch to Cinema4D via OBJ
Total newbie here. And I recognize that this isn't strictly a developer question. But it is where Photo Capture lead me. So... We're having trouble with the OBJ files generated by Photo Catch being recognized by Cinema4D. Is anyone having thew same issue? There's not a lot to adjust in Photo Catch so I'm not entirely sure where we would go wrong here. If this isn't the right place for these questions. can you steer me to where I should go? Much obliged!
Replies
0
Boosts
0
Views
666
Activity
Feb ’22
MTLDebugCommandBuffer lockPurgeableObjects
I'm using Xcode 13 after recently updating to MacOS Monterey, and only after updating am I getting this error: [MTLDebugCommandBuffer lockPurgeableObjects]:2103: failed assertion `MTLResource 0x14a8a8cc0 (label: null), referenced in cmd buffer 0x149091400 (label: null) is in volatile or empty purgeable state at commit' I haven't changed my code at all between updating to the latest OS, and it worked perfectly before. How can I fix this? I don't think there should be any reason that I can't use a command buffer on a texture resource with a volatile/empty purgeable state.
Replies
4
Boosts
0
Views
4.1k
Activity
Jan ’22
MTLDevice.currentAllocatedSize incorrect on late 2014 iMacs
I have two iMacs where MTLDevice.currentAllocatedSize is acting strange--the reported size keeps rising, despite periodically freeing resources to keep under MTLDevice.recommendedMaxWorkingSetSize. The affected iMacs are both late 2014 models running MacOS Big Sur 11.6, one with an AMD Radeon R9 M290X and the other with an AMD Radeon R9 M295X. So far none of our other Macs have shown this behaviour, which suggests this may be an API or driver problem. I do have the option of using my own resource size estimates, but that's likely not as accurate as what the system reports, assuming MTLDevice.currentAllocatedSize is working properly. Any suggestions?
Replies
2
Boosts
0
Views
1.9k
Activity
Dec ’21
Error while converting MTLTexture to CVPixelBuffer
I am getting an error from the graphics driver while converting the EnvironmentTexture(from ARKIT.AREnvironmentProbeAnchor) to CVPixelBuffer. The EnvironmentTexture is an IMTLTexture. I am using Xamarin.iOS. This is the code that I use to convert the IMTLTexture to CVPixelBuffer. buffers[i] = new CVPixelBuffer((nint)epAnchor.EnvironmentTexture.Width, (nint)epAnchor.EnvironmentTexture.Height, CVPixelFormatType.CV32RGBA); GetEnvironmentTextureSlice(buffers[i], epAnchor.EnvironmentTexture, i); public void GetEnvironmentTextureSlice(CVPixelBuffer pixelBuffer, Metal.IMTLTexture texture, int id) { Metal.MTLRegion mtlRegion = Metal.MTLRegion.Create2D((nuint)0, 0, 256, 256); nuint bytesPerPixel = 4; nuint bytesPerRow = bytesPerPixel * (nuint)mtlRegion.Size.Width; // (nuint)pixelBuffer.BytesPerRow; nuint bytesPerImage = bytesPerRow * (nuint)mtlRegion.Size.Height; pixelBuffer.Lock(CVPixelBufferLock.None); texture.GetBytes(pixelBuffer.BaseAddress, (nuint)pixelBuffer.BytesPerRow, mtlRegion, 0); pixelBuffer.Unlock(CVPixelBufferLock.None); } The error I am getting from the driver is AGX: Texture read/write assertion failed: bytes_per_row = used_bytes_per_row I tried with different values of pixelBuffer.BytesPerRow but still getting the error. Can someone help me?
Replies
1
Boosts
0
Views
2.7k
Activity
Dec ’21
3D object on websites
I want to put on 3D object on websites, but I don’t know how to do. It doesn’t explain AR such as Apple’s product page. It explain like top page’s earth of github.com. In short, I want to put 3D object without page-jumping. This question is maybe not adopted here -apple developer forum-, however I want someone to answer this.
Replies
2
Boosts
0
Views
1.8k
Activity
Nov ’21
vkCmdDrawIndexedIndirectCount functionality under Metal
Hello, It looks like my previous question was closed without being resolved. https://developer.apple.com/forums/thread/668171 There are FPS values from our new benchmark. Indirect command buffers are not working properly. So there is no way to emulate multi-draw indirect count functionality other than a loop of draw indirect commands. As you can see below, the same hardware is working three times slower under Metal because of it. And Apple M1 performance is worse than AMD integrated graphics performance. We have a buffer with multiple draw commands. How should we render it efficiently under Metal? AMD Vega 56 eGPU: Direct3D12: 94.0 Direct3D11: 87.2 Vulkan: 91.1 Metal: 35.8 AMD Ryzen™ 7 4800H: Direct3D12: 21.1 Direct3D11: 19.4 Vulkan: 20.5 Apple M1: Metal: 16.9 Thank you
Replies
9
Boosts
0
Views
3.7k
Activity
Nov ’21