I want to lit the parts of the object marked wrong. I imagined it like the light area on the object is somehow stretched. I had the idea of bending the surface normal used for the NdotL term a bit in the direction if the light source depended on how small the first NdotL term is getting. So the light area is a bit overlapping its correct borders but will shadow out correctly. Does anybody have an idea on how to do this? thank you very much
🔒 Locked
Howto: wrong lighting :)
Advertisement
Original Post
Hi, I'm trying to modify a lambertian diffuse lighting in a way that the light covers an object further than it should. I've made a little draft for it:
I want to lit the parts of the object marked wrong. I imagined it like the light area on the object is somehow stretched. I had the idea of bending the surface normal used for the NdotL term a bit in the direction if the light source depended on how small the first NdotL term is getting. So the light area is a bit overlapping its correct borders but will shadow out correctly. Does anybody have an idea on how to do this? thank you very much
I want to lit the parts of the object marked wrong. I imagined it like the light area on the object is somehow stretched. I had the idea of bending the surface normal used for the NdotL term a bit in the direction if the light source depended on how small the first NdotL term is getting. So the light area is a bit overlapping its correct borders but will shadow out correctly. Does anybody have an idea on how to do this? thank you very much
Quote:
Original post by Grey_
Why don't you just scale/remap the dot to whatever you want? so right now it's 1 to -1, just remap it to 1 to 0 or whatever you want. You could also look at doing a 1D texture look up to take the technique further.
QFT. If you do a little scale/bias to bring the dot product result into the range 1 to -0.5 or whatever you want, that'll do exactly what you need.
Thank you.
It was the first thing I tried. But it wouldn't work for *me*. The reason it didn't worked: I forgot I always clamped the NdotL values (to [1.0...0.0]) [embarrass]
It was the first thing I tried. But it wouldn't work for *me*. The reason it didn't worked: I forgot I always clamped the NdotL values (to [1.0...0.0]) [embarrass]
Quote:Very interesting and looks indeed quite nice! Thanks
What your after looks alot like the lighting model (they call it 'half-lambert') used in the Source engine (http://www.ati.com/developer/siggraph06/Mitchell-ShadingInValvesSourceEngine.pdf).
So instead of using:
NdotL
You could use:
((NdotL*0.5)+0.5)^2
I am wondering what is the point of such lighting. it doent seem like it can look natural.. is it used for some special effect?
It's a cheap way to fake a certain amount of subsurface scattering. On a human face for example a light shining from behind will scatter through the translucent layers of the skin and off fine hairs on the skin which will give a bit of a rim lighting type effect. Pushing the light a bit around the 'correct' cut off point for opaque lambertian diffuse lighting captures some of the visual look of the complex light transport that's going on for a translucent object. For skin shaders it's common to also tint the light that bleeds around the edges slightly red to approximate the effect of scattered light passing through blood vessels.
[edit]Here's an example of backlighting in a real photo, notice how light bleeds around the edges of the face:
[edit]Here's an example of backlighting in a real photo, notice how light bleeds around the edges of the face:
Quote:
Original post by quasty
Does anybody have an idea on how to do this?
NdotL*0.75+0.25 would give you the requested result, but to simulate subsurfacescattering it would be better to use the viewdirection instead of the lightdir, something like;
float SSS=pow(1.f-dot(N,ViewDir),8);Quote:
Original post by zedzeek
this is true, so im being a prick :)
but here im sure its also due to the hair on the face / jumper (like the hair on the head but obviously much shorter)
Which is why I said:
Quote:
On a human face for example a light shining from behind will scatter through the translucent layers of the skin and off fine hairs on the skin
[grin]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement