Real time rim light

Hello everyone. I have a question about real time material nodes.

I want to make a rim light. Without light.

My method is to link the normal to a ramp like this:


The question is how can i mask the center of the rim light as folow:


(this is just a gimp paintover to show what i want to optain)

use the view angle to set the emission value

I would use a ‘add’ mixRGB with the mix set by the view angle to do it.

thank you BluePrintRandom… I will try it and come back with the result.

By view angle, you mean the node called ‘camera data/view vector’ right ?

Hello again BluePrintRandom. I tried to play around with what you suggested:

[ATTACH=CONFIG]477381[/ATTACH]
It is closer to what I expected, thank you.

here is the material node setup:

[ATTACH=CONFIG]477382[/ATTACH]

this is the best way i think, color ramp optional. this way you can have control of what the rim color is, maybe varied based off of sun vector. you could make it an add, or just make another material with the emit up a little.



You could do it in post processing. This isn’t a well understood thing in BGE, but it is easily doable, and I’ve been doing it for quite a while now to achieve fancy effects.

This allows you to render out the ‘mask.’ A simple example where I rendered out a ‘mask’ for things is this image where I rendered a seperate pass with just the highlighted object (a chair) on it. (In this scene the object you were looking at highlighted, including the table, books etc.)
/uploads/default/original/4X/2/5/4/2542b88271b471802a28ed6c5f251478cf01d5ab.jpgstc=1
I then applied a filter on it to only get the outline, but the same solution could be used to do outlining/highlighting.