Jump to content

sprite node ( not sure to like it)


vbk!!!

Recommended Posts

yo,

Sprite node allows to put some sprtiet shader to particle. It's great but ...

The Scale of the sprite is control by the Sprite node and I am not sure to like it.

I would ike to be able to change the size of my sprite with my shader instead of Sprite Pop

Is it possible ?

Thanks for your help

Link to comment
Share on other sites

No. By the time the shader is called in Mantra, the geometry has already been constructed.

You can control the size of the sprite using an Attribute Create SOP after the particle system.

Here are the values that you need to change:

Name: spritescale

Size: 3

Value: 0.8 0.8 0 0

where you can manipulate the first two values to control the x and y size of the sprite.

The key is to mmb on the popnet SOP and see that there is a vector attribute called spritescale created by the Sprite POP. All attributes are fair game to modify them after they are created.

Link to comment
Share on other sites

  • 3 weeks later...

Doing it in the sprite POP gives you a lot of control over the size via expression though... you are able to use the life, id, point number, age, sprite size, rotation, and offset... in the example i uploaded im only using the basic dust sprite shader, but using the color POP to set my color, and alpha which controls the color and opacity in the shader... hope this helps!

-Glenn

SpriteTestOdF.hip

Link to comment
Share on other sites

I would ike to be able to change the size of my sprite with my shader instead of Sprite Pop

Is it possible ?

i am not sure what benefit would that have

if you want to change the spritescale after POPs have been cached to disk and read back, you can do that in SOPs easily

but if you need, yes, it is possible to do it in shader

set your spritescale to maximum desired size of the sprites

then you can just change uvs in the surface shader to vary the scale per particle

the easy method for that is

UVcoords VOP -> Transform Matrix VOP (pivot set to 0.5 0.5) -> rescaled uvs, drive whatever sprite texture you want with them

UVposition may work too, maybe it's better if you need s,t as input values for your texture

just make sure the opacity is set right for your sprite to make everything outside the uv range transparent

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