• Advertisement
Sign in to follow this  

Default light ambient, diffuse and specular values?

This topic is 1234 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello,

 

I am aware that the question is tricky: taking into account the common fileformats that allow to import meshes with color information (e.g. OBJ), what is the best light settings for my default lights in a scene, so that the imported object looks "as it was meant to look"? I am not talking about the light intensity, but rather the appropriate proportions between ambient, diffuse and specular components.

 

I currently use values similar to:

 

overall ambient light component (not bound to a light source): 0.2

ambient light component (bound to light source): 0.25

diffuse light component (bound to light source): 0.5

specular light component (bound to light source): 0.6

 

but the imported object shapes sometimes do not look contrasted enough. I understand that I have to increase the diffuse and/or specular components, but in which proportions?

 

Thanks for any hint.

Share this post


Link to post
Share on other sites
Advertisement

a quick follow-up question though... you wrote "my advice would be for per light ambient to be very low or zero, and per light diffuse/specular to be equal".

 

If I do that, then I need to code the color in the diffuse channel, right? As for now, I specify an objet's color via the ambient component (of the object). Its diffuse component is always grey, i.e. it adds some diffuse effect, but not in the color of the object.

 

Would that mean I could drop the object's ambient channel, and only work with the object's diffuse and specular channels?

Share this post


Link to post
Share on other sites

a quick follow-up question though... you wrote "my advice would be for per light ambient to be very low or zero, and per light diffuse/specular to be equal".

 

If I do that, then I need to code the color in the diffuse channel, right? As for now, I specify an objet's color via the ambient component (of the object). Its diffuse component is always grey, i.e. it adds some diffuse effect, but not in the color of the object.

 

Would that mean I could drop the object's ambient channel, and only work with the object's diffuse and specular channels?

You can do whatever you feel like doing.

 

if you don't use an ambient channel, then you won't have any extra light appear on your object, which is ok. I hardly use ambient.

 

If you want the values to look "Exactly as they should be", well... there's no such thing.

 

A 3d object made in a 3d modelling tool will look different depending on what internal shaders are being used, and what type of lighting you are using (e.g. Lambertian, Phong, etc.). There is no native look.

Share this post


Link to post
Share on other sites

If I do that, then I need to code the color in the diffuse channel, right? As for now, I specify an objet's color via the ambient component (of the object). Its diffuse component is always grey, i.e. it adds some diffuse effect, but not in the color of the object.
 
Would that mean I could drop the object's ambient channel, and only work with the object's diffuse and specular channels?

Physically speaking, diffuse and ambient material colours are the same thing; it doesn't make sense for them to be different. Diffuse is the colour that the object scatters when directly lit, and ambient is the colour it scatters when indirectly lit. An object can't know whether light that's hitting it has arrived directly from a light source, or has indirectly arrived after bouncing arround, so it's impossible for these two values to be different.
I'd recommend getting rid of the material ambient colour, and simply using the material diffuse colour if/when using "ambient lights".
 
On the same topic, for non-metal materials, the specular colour should almost always be a greyscale value, as reflections off these materials are not discoloured.
However, metal materials should have their main colour in the specular component, and should be very dark (or black for pure metals) in the diffuse/ambient component, because refracted light is absorbed into metals as heat, instead of being diffused/re-emitted.

Share this post


Link to post
Share on other sites

If you want something practical just to get a quick and dirty outdoor lighting setup for model viewing, Inigo has a nice and sensible setup http://iquilezles.org/www/articles/outdoorslighting/outdoorslighting.htm

 

The look of your materials comes down to what lighting model you're using. PBR models are pretty common now and there's plenty of information about all of that online. There's code for the models floating around out there, but it's worth getting to know what you're doing and why.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement