Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Rotating Object Via Shader Graph

JordyJordy Member
edited May 20 in 3D Art

Hi! I am currently racking my brain about a method I have seen to rotate objects around an axis in a shader rather than computing it via Update(). Looking at a sample game unity made (Trash Dash), they have created a shader to do this.

I was wondering if this is possible to do via Shadergraph, plugging it into the "Vertex Position" of PBR Master/ Unlit Master node.

My Current Method is to do it via script in Update() doing

transform.Rotate(Vector3.Up * 50 * Time.deltaTime);

Can anybody suggest a method of achieving the same effect via Shadergraph?

Thanks for taking the time to read!

Comments

  • EPIKujikEPIKujik Member

    Interesting. Would like to know if this is possible with Shaders.

  • DFYXDFYX Member

    It's actually super simple. The important thing is to set the position node's coordinate space to object.

    Realistically you should probably also rotate the normal vector and maybe tangent vector with the same method. Otherwise your shading will look weird.

  • JordyJordy Member

    Thankyou mate :) I feel silly now as I have attempted to use Rotate about axis, but just used it wrong 🤣 Thankyou for the help kind sir

Sign In or Register to comment.