#help with shader graph pls

1 messages · Page 1 of 1 (latest)

rose geyser
calm sail
#

I think you want the vertical gradient to multiply the offset, not the computed world position :

rose geyser
#

I wanted my trunk to swing with the foliage, but can you help me with that?

rose geyser
#

or thats my leaves which are shifting

calm sail
#

Instead of posting a video, could you post a high resolution enough screenshot of the vertex part of the shadergraph with readable node names ?

calm sail
#

I don't know how you did the wind effect for the leaves, but the principle behind trees wind is the following : The wind offset needs to be cumulated from the root of the tree that is static to the tip of the leaves that have the most movement.
Very often this is done my storing a sort of "wind mask" in the vertex color or secondary UVs of the trunk/leaves, an apply this mask on the exact same wind displacement logic (to have the trunk/branches/leaves in sync).

#

Here for example you are using the UV.y to mask the wind on the trunk. But for the leaves to follow it, even if they are using the same wind noise, they also need to have this masking information.

rose geyser
#

I wanted to do it with the help of the preview, but I couldn't make the trunk seem to move either.

rose geyser
calm sail
#

IDK how the tree you have is build, but what you could do is use the object position as single source for a base noise that affects the trunk and the leaves.
Then you need a way to have a uniform vertical mask to have the trunk sway and the leaves follow. Currently your using UV.y for the trunk, but I'm pretty sure it's not the same for the leaves.

You could instead use the Y coord of the object space position.
That way the leaves should follow the trunk.

Then you need a mask from the base to the tip of the leaves to have individual sways. Maybe UV can be used for that.

rose geyser
#

idk what to do

calm sail
#

I tried to give you hints and instructions here, I'm not going to do the shader for you ...

#

Some pseudocode maybe ?

trunkNoise = positionOS.y * noise( objectPosition.xz);
positionOutputOS = positionOS + trunkNoise;

leaveNoise = trunkNoise + leaveMask * noise( positionWS.xz );