Signal Line Improvement

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:

old-signal-line

The first thing I worked on was getting the corner right this time:

line_corner

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:

line_time_color_change

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:

emission_map_timing

From here, I wrote a script so that I could have different start times on the emission transition:

line_different_time_color_change

And here’s how it looks going around a corner:

line_emission_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.

 

 

 

 

  • Facebook
  • Twitter
  • Tumblr
  • LinkedIn
  • del.icio.us
  • Google Bookmarks
  • Reddit
  • StumbleUpon
  • RSS

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>