|
I was hoping by now we might see a VisionOS forum... In the meantime, I've been struggling to figure out a way to programatically draw tetrahedra and then, with vertex colors defined, blend them over the faces. (This would be useful for a variety of computational results, including finite element models.) I found a very helpful post on https://stackoverflow.com/questions/77341804/how-can-i-use-a-scenekit-mesh-in-realitykit that draws a 4-noded tetrahedron, all one color. I've also tried to follow Apple documentation that should lead me to the blended vetex colors with a color triangle, but the example is incomplete, and I just don't know enough about Metal to fill-in the blanks for the triangle, much less get it to work with the tetrahedron faces. See https://developer.apple.com/documentation/realitykit/modifying-realitykit-rendering-using-custom-materials If someone else is working on this kind of issue and willing to provide a complete example for the color triangle, it would be very much appreciated! Here's the code, almost exactly the same as from the stackoverflow link, that draws a tetrahedron:
|
|
OK, I still think it's time to start a forum for VisionOS, although I've gotten no feedback at all... I have, however, made a bit of progress with my issue of programatically drawing tetrahedra with blended colors across the faces. Unfortunately, this uses the coordinates of the vertex to convert to colors for blending (as shown with the attached ShaderGraph material flowchart). What I'd like to do instead is to define the colors of the vertices progromatically, and then have the colors blended over the faces. If anyone has pointers for that, please let me know. Here is the current ShaderGraph flowchart: https://www.icloud.com/iclouddrive/0472XQjUY27dhMnC1fTg2y9DA#SchaderGraph_flowchart Here is the current code:
And here is the output on the VisionOs simulator: https://www.icloud.com/iclouddrive/0bf0Mi4B04iVLZZnafYXYp7QQ#Tet%5FGradient |
|
|
|
Still no info about a VisionOS forum, but thanks to help from Apple Techincal Support, I can programatically draw tetrahedra and then, with vertex colors defined, blend them over the faces.
Here's the key: the shadergraph |
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.