Hey everyone, been banging my head against that wall and have realized I need to go about learning shaders in a different way. But in the meantime I’ve decided to seek help to get a bit of guidance.
What I am trying to do is create a surface shader (Assuming its surface shader) that would draw the texture on the bottom half of the mesh, and a solid color on the top, based on a percent pass by from a script.
Based on my paint skills hopefully the image gives a representation of what I’m hoping to do. What should I be researching (terms, type of shader etc) for me to achieve this effect? As much as I’d love to straight out ask for someone to write a shader, I won’t learn anything.
Well for the most part it’s coming along, using the world position got me off on the right foot anyways and a bit of research.
So, with the lerp I’m going to be getting that blended fade into the color, which I’m looking for a solid straight line with its height being determined by a float that’s passed to the shader from script (In a sense a range of 0-1 for percent)
Now I’m looking to base this off of local coordinates so I will have to figure out how to find the min height and max height of the model in world coordinates. World to local is simple enough, but as for figuring out the maxHeight I’m not to sure.
The desired effect I’m going for is a “building” in an RTS to be filled with its required resources. The amount of resources is represented by a percent (Which is passed to the shader to show the blue color as representation of how much is left to go) Hope that use case makes sense.