Jump to content

Shader Attributes on a per particle basis


Recommended Posts

I'm working on the 3d Buzz sprite rendering tutorial. I'm rendering out particles as sprites with the VEX Polka Dot shader attached to them. I want the Frequency and the Dot Color for the sprites to change on a per particle and a per frame basis. However, when I put the expression "rand($FF+$PT)*25" into the shader's Frequency parameter, I gott an error message:

Unable to evaluate expression. Undefined variable.

I played around with the expression. I think the shader parameters don't like the $PT variable. How can I get around this?


Link to comment
Share on other sites

I think the shader parameters don't like the $PT variable.

$PT is a local variable of some SOPs.

You need to create an attribute and read this in the shader using a parameterVOP.

Just like in this example: http://forums.odforce.net/index.php?showto...p;hl=$LIFE

Instead of $LIFE you need to write $PT or you expression into the attribute.

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.

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...