Ask Your Question
2

How can I make a specific pattern texture appear at a specific time on top of a scrolling empty texture in the Unity Shader Graph?

asked 2022-01-03 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2022-10-08 22:00:00 +0000

nofretete gravatar image

There are several ways to achieve this effect in the Unity Shader Graph. Here is one possible approach:

  1. Create a new shader graph and add a Texture 2D node for your scrolling empty texture.

  2. Add a Time node to your shader graph to control the scrolling speed and direction.

  3. Create a new Material using your shader graph.

  4. Add a pattern texture to your project assets and import it into Unity.

  5. Create a new Texture 2D node for your pattern texture and set it to Repeat in the Texture Sample node.

  6. Use a Math node to multiply the UV coordinates of your pattern texture by a desired scale factor.

  7. Connect the Time node to the UV input of the Texture 2D node controlling your empty texture, and adjust the speed and direction as desired.

  8. Connect the scaled UV coordinates from step 6 to a Texture Sample node for your pattern texture, and mix it with your empty texture using a Blend node.

  9. Use the output of the Blend node as the final output for your shader graph.

  10. Apply the material to a mesh or sprite renderer in your scene, and adjust the scrolling speed and scale factor as desired to achieve the desired effect.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-01-03 11:00:00 +0000

Seen: 9 times

Last updated: Oct 08 '22