Been working on improving the signal line in the game. The signal lines connect the squares to a door, and when you put a box on a correct square, the line lights up.
This is what the old version looks like:
The first thing I worked on was getting the corner right this time:
Mostly, this was just creating a special texture for the end of one straight line segment.
Next, I wanted to make it so that the lit up color traveled through the line.
This involved writing a surface shader (because I wanted environmental lighting accounted for), and connecting the time to the y axis, so that whatever pixel’s y coordinate value was below the current time, the color would be different:
BTW, really handy manual on surface shader writing here. Contains all the different in SurfaceOutputStandard variables, etc.
After that, instead of merely changing the color, I added emission to the shader (emission color, emission strength, and emission map). Note that emission is additive:
From here, I wrote a script so that I could have different start times on the emission transition:
And here’s how it looks going around a corner:
Right now I have to manually enter the timing of each separate piece, but once I figure out the exact relationship between time and length of line, I should be able to automate it.