Lookup Table

This is the 2D lookup table I used in the composition below.Colours are looked up across the width (X-axis) of the table, based on the distance of the current fragment from a ‘light source’ (though no real lighting calculations are made). There’s a control to shift the position on the Y-axis of the lookup, allowing fading from one kind of shading gradient to another (ie negative to positive). The looked-up colour is then multiplied with the Color input to the shader to produce the final fragment colour.

Lookup Table 04

The sixth strip is a noise texture. Not too useful on its own, but can give nice results in the transition-zone between it and the linear gradients above and below it. When I finally get around to working out how to do proper directional lighting, though, it might be nice to add a little noise to the colour of the mesh, for a kind of contour-like effect.
I’m thinking it might be nice to combine this simple shading with a basic directional lighting model, to make the mesh look as though it’s being lit from within. Not sure if the image in my head will correspond to the reality, if I ever get it working, but in theory it should look quite nice…

I’m also planning to add a control to alter the range and maybe the falloff curve of the shading effect. Might be a good opportunity to make use of the variable smoothstep-like function my friend Nick helped me work out last week.


0 Responses to “Lookup Table”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

March 2008
« Feb   Apr »


Blog Stats

  • 476,450 hits

%d bloggers like this: