- Home /
Building under construction transitions from transparent glow to opaque texture
My goal is to have a building under construction start out as a blue, glowing shape, but as progress is made on construction, the bottom section become opaque, showing the final texture, and further progress causes more and more of the building to become opaque and non-glowing, until the building is complete.
Here's what I have so far: As the HP of the building under construction increases, more of it is shown. Unfortunately, this required setting the UV map on the model to be a vertical projection, and I also had to use a single image for the glow and the grey, which moves upwards (by changing the texture offset) as progress happens. Both of these rule out having an actual image texture shown as the building is constructing.
Is there any way to get the construction effect to work like I described it at the start?
Also, it would be nice to have the top sections of the building start out semitransparent, rather than absent, and fade in, but if I set the Rendering Mode of the material to Transparent or Fade, I've had issues with the sections that should be opaque still being transparent.
Here's a link to the simplified project file: https://drive.google.com/open?id=1z0e1xM3mgLc7fZRqGDdl0nV3HFXw5ukl
Your best bet would be to write a shader to do this. You can program it to do something if the y position of the pixel is below a float threshold. So you could set it to make the object a transparent colour when above that threshold and not when it is below.
Your answer
Follow this Question
Related Questions
Changing two different objects renderer colour 1 Answer
How to switch the texture being used by the material of the mesh renderer 1 Answer
How to change a value in custom shader through script, C# 1 Answer
"not a valid texture file name" error generated when importing Blender mesh into Unity 1 Answer
change child texture problem 2 Answers