Default light ambient, diffuse and specular values?

Started by
5 comments, last by tetron 9 years, 6 months ago

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.

Advertisement
There's no answer to this, it's a complete hack, for artists to play with.

It makes no physical sense to begin with. Ambient value on a light source is the amount that the light affects every object everywhere from every direction - Jesus photons. The diffuse/specular light scales say how bright the light is for refractions/reflections respectively; you can emit a photon, wait to see if it's firs event is a refraction (diffuse) or a reflection (specular) and then change the intensity of your light source after the fact.

If you're trying to emulate another program that uses this completely fictional lighting model, then the answer is - the same values that the artist was using in that program.
If you don't know, my advice would be for per light ambient to be very low or zero, and per light diffuse/specular to be equal.

If you're not trying to emulate another program, then you're free to choose a more sensible lighting model. In such cases, art is typically made specifically for a particular game, and artists will preview there work within that game to tweak the light/material values appropriately.

If you just want to see the shapes of models clearly, I'd try the also-completely-fake half-Lamber diffuse model, with 2 light sources of contrasting colours - e.g. A pink and a teal directional light comin from top-left and top-right. The half-Lamber model ensures the gradients wrap all the way to the back, avoiding the flat look that plain ambient gives you.

Moser physically based lighting models do not have seperately ambient/diffuse/specular ratios per light because as above, it's nonsense; they just have a single colour/intensity per light, and then the interesting ratios are part of the materials.

Thank you Hodgman!

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?

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.

View my game dev blog here!

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.

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.

This topic is closed to new replies.

Advertisement