medieval_cortex Posted April 14, 2022 Share Posted April 14, 2022 (edited) Hi, I'm trying to render particles in Mantra. Ideally I want to render them as grids that would act like sprites (always facing the camera). I have all this figured out but now I want to use the age attribute of my particles to control the Alpha value of the shader on each individual particles. Just like in the POP color node, but it needs to render with Mantra. I'm struggling to find resources that would teach me how to do this, most tutorials on particles are rendered as spheres. Mine will be various images of abstract forms with an alpha channel. TL;DR: render particles as object and control the opacity of the shader based on the "age" attribute. particles2.hipnc Edited April 14, 2022 by medieval_cortex Quote Link to comment Share on other sites More sharing options...
Atom Posted April 14, 2022 Share Posted April 14, 2022 Try using an Import Attribute node inside your shading network. Type the word Alpha and remember to change the signature from vector to float. Quote Link to comment Share on other sites More sharing options...
medieval_cortex Posted April 14, 2022 Author Share Posted April 14, 2022 (edited) 43 minutes ago, Atom said: Try using an Import Attribute node inside your shading network. Type the word Alpha and remember to change the signature from vector to float. This is something I've tried, but it doesn't combine with the Alpha of a texture (which is ultimately what I want). See attached hip file. And btw sorry for my previous hip file with all the broken links! I made a new one that clearly demonstrate the issue. Although the solution might just be to separate channels from the image textures, use luminance or alpha channel for the multiplication instead of what I did in the screenshots. particles2.hipnc Edited April 14, 2022 by medieval_cortex Quote Link to comment Share on other sites More sharing options...
medieval_cortex Posted April 14, 2022 Author Share Posted April 14, 2022 (edited) Finally got it working, I was so close to the solution but kept running into a wall for quite a while. Anyway thank you, I'm leaving the post for future reference. Edit: sigh... This is bugged. Sometimes it will show the right texture and sometimes it won't with the exact same setup. Edited April 14, 2022 by medieval_cortex Quote Link to comment Share on other sites More sharing options...
Atom Posted April 14, 2022 Share Posted April 14, 2022 (edited) Perhaps some of the particles are facing away? Try using vex code to orient them toward the camera. You'll have to switch your copied grid from XZ to XY. string cam = chs("cam"); matrix camX = optransform(cam); @orient = quaternion(matrix3(camX)); Edited April 14, 2022 by Atom Quote Link to comment Share on other sites More sharing options...
medieval_cortex Posted April 14, 2022 Author Share Posted April 14, 2022 (edited) 1 hour ago, Atom said: Perhaps some of the particles are facing away? Try using vex code to orient them toward the camera. You'll have to switch your copied grid from XZ to XY. string cam = chs("cam"); matrix camX = optransform(cam); @orient = quaternion(matrix3(camX)); No I think it's mostly an issue with copy to points not transferring the UV? I don't know. What I want is simply to have the texture on all the grids and have them appear and disappear gradually based on their respective particle age. I tried everything, and I feel like mantra is taunting me at this point because it will sometimes show the result I want but it's like a viewport bug??? I've made a new .hipnc for anyone that would like to help me: particles_mat.hipnc Edited April 14, 2022 by medieval_cortex Quote Link to comment Share on other sites More sharing options...
Atom Posted April 16, 2022 Share Posted April 16, 2022 You do have to add UVs to your grid before you copy it to points. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.