Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTsus

Posted 14 September 2012 - 01:34 PM

Hi again!

First of all, thank you very, very much for the model! Posted Image

Sorry, if we have lost you on the way with all the units (not all of them were explained). Photometrically correct lighting is sometimes a little overwhelming, when you’re not working with it every day.

I glanced a little longer at your code and noticed that you should probably normalize the normal in your pixel shader. Even if the normals are normalized in the vertex shader, the interpolated normal may not be normalized, when it arrives in the pixel shader. Despite from that it looks all fine. What happens if you move the light closer? Any chance to get it brighter?
Perhaps a squared fall-off isn’t a good idea if you only have one bounce of light. Would it work better in your scene, if you’d use a linear fall-off?

To answer your other question, the ambient light A can be a color (float3). It is used to model the indirect light that bounced between surfaces. If you’re in a room with many red walls, the ambient light would mostly be red.

The reflection model of your book looks almost like standard phong, except for the ambient part. But it is okay, to model it that way. The fixed function pipelines did it a little different, but that’s a matter of taste. Often games change the tone of the lighting or add additional terms, to achieve a certain look and feel, though it might not be “correct” in any way. A nice example is in John Edwards' talk on the sand rendering in Journey (second last section of that page).
Probably it’s best not to worry too much about the lighting, as long as it looks good. Posted Image

Best regards!

#1Tsus

Posted 14 September 2012 - 01:33 PM

Hi again!

First of all, thank you very, very much for the model! :-)

Sorry, if we have lost you on the way with all the units (not all of them were explained). Photometrically correct lighting is sometimes a little overwhelming, when you’re not working with it every day.

I glanced a little longer at your code and noticed that you should probably normalize the normal in your pixel shader. Even if the normals are normalized in the vertex shader, the interpolated normal may not be normalized, when it arrives in the pixel shader. Despite from that it looks all fine. What happens if you move the light closer? Any chance to get it brighter?
Perhaps a squared fall-off isn’t a good idea if you only have one bounce of light. Would it work better in your scene, if you’d use a linear fall-off?

To answer your other question, the ambient light A can be a color (float3). It is used to model the indirect light that bounced between surfaces. If you’re in a room with many red walls, the ambient light would mostly be red.

The reflection model of your book looks almost like standard phong, except for the ambient part. But it is okay, to model it that way. The fixed function pipelines did it a little different, but that’s a matter of taste. Often games change the tone of the lighting or add additional terms, to achieve a certain look and feel, though it might not be “correct” in any way. A nice example is in John Edwards' talk on the sand rendering in Journey (second last section of that page).
Probably it’s best not to worry too much about the lighting, as long as it looks good. :)

Best regards!

PARTNERS