Answer the question
In order to leave comments, you need to log in
How to create a shader that fills a mesh plane with two textures?
I want to learn how to write shaders. And for training I chose the goal to create 2d water. For further experiments, we need to create a simple shader that will fill the mesh with two textures, one of them should be at the top and fill only horizontally, and the second texture should fill the rest of the space, but not replace the first one if there is not enough space. I turned Google over for all the queries that came to mind, but did not find what I needed.
Here are examples of what we would like to get as a result:
If the height of the mesh is equal to the height of the first texture or less, then the second texture should not be visible at all:
If there is not much room for the second texture, then it should be clipped so that the first one always fits completely vertically:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question