Jump to content

Particles rendering as object with "age" attribute driving opacity


medieval_cortex

Recommended Posts

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.

Capture_viewport.PNG

 

particles2.hipnc

Edited by medieval_cortex
Link to comment
Share on other sites

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.

Untitled-1.jpg

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.

no alpha.PNG

no texture.PNG

 

particles2.hipnc

Edited by medieval_cortex
Link to comment
Share on other sites

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.

kkkk.PNG

ppp.PNG

Edited by medieval_cortex
Link to comment
Share on other sites

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));

 

Untitled-1.jpg

Edited by Atom
Link to comment
Share on other sites

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));

 

Untitled-1.jpg

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

flame_test.png

Edited by medieval_cortex
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...