Jump to content
  • Advertisement
Sign in to follow this  
maya18222

Light Theory Questions

This topic is 3027 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

1. When rendering objects such as a shiny red ball in computer graphics. You generally calculate 2 terms and add them together. That is the Diffuse and Specular term. But if you have a super shiny red ball, with a sharp highlight. Doesnt that mean that its surface, is very smooth, and so it should exhibit a higher rate of specular reflection and very little diffuse reflection. That is the object should see little of its material colour, and should highly reflect its enviroment. Yet we seem to always calculate the diffuse in full, and the specular contribution dpending on the smoothness level, and add them together. That is how can a surface be a fully diffuse surface and a fully specular surface? If we find that the surface has a smooth surface, shouldnt the calculation use less of the "Diffuse reflection" term? yet that never seems to happen. 2. From my understanding, it is only diffuse reflection that absorbs colour from the ray that strikes, that is, it reflects a different coloured ray than the one that striked the surface, due to absorbtion. Where as specular reflection reflects the exact ray without any absorbtion, thus no colour change. But why is this? From all the diagrams you see, both specular and diffuse are cases of reflection, just with different incident angles depending on how smooth the surface is. Why is it that specular reflections dont absorb colour from the striking ray, yet diffuse reflection does? 3. If a surface is highly smooth, then specular reflection takes place and little absorbtion. Yet if a surface is fairly rough, then diffuse reflection takes place and more absorbtion, as shown below. So what does it mean for a surface to be, in the "middle"? In that its not rough but its not smooth? To model this, would you LERP between a fully specular reflection ray colour and a fully diffuse ray colour, depending on how smooth the surface is? 4. Why is it that surface and light descriptions also contain a specular colour parameter? Shouldnt the reflected ray colour be calcuated from the general light colour that the surface was struck with? why use a specular colour instead? 5. What causes a light ray to dimminish? From my understanding, it will dimminish as it is absorbed over multiple bounces within the enviroment. But if the enviroment was to contain infinitley smooth surfaces, does that mean the the light ray in thoery would be bouncing around indefinitely?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by maya18222
1. When rendering objects such as a shiny red ball in computer graphics. You generally calculate 2 terms and add them together. That is the Diffuse and Specular term. But if you have a super shiny red ball, with a sharp highlight. Doesnt that mean that its surface, is very smooth, and so it should exhibit a higher rate of specular reflection and very little diffuse reflection. That is the object should see little of its material colour, and should highly reflect its enviroment. Yet we seem to always calculate the diffuse in full, and the specular contribution dpending on the smoothness level, and add them together. That is how can a surface be a fully diffuse surface and a fully specular surface? If we find that the surface has a smooth surface, shouldnt the calculation use less of the "Diffuse reflection" term? yet that never seems to happen.

You are absolutely correct. The Phong/Blinn model is a very rough approximation of reality, and is not physically correct. A physically based, energy preserving shader will indeed function as you described. More specular reflectivity means less diffuse reflection. Energy conservation requires this. A chrome surface, for example, will have a very high amount of specular reflection, yet a very low amount of diffuse reflection. Both terms (assuming a non-transparent material) must add up to 1.

Quote:
Original post by maya18222
2. From my understanding, it is only diffuse reflection that absorbs colour from the ray that strikes, that is, it reflects a different coloured ray than the one that striked the surface, due to absorbtion. Where as specular reflection reflects the exact ray without any absorbtion, thus no colour change. But why is this?

It isn't. This behaviour is again a very rough (and incorrect) approximation. In reality, it depends on the type of material. Basically, materials can be classified into three major classes: dielectrics, semi conductors and conductors. Light reacts differently when it strikes these materials. In general, dielectrics will not tint the specular reflection. Conductors, such as metals, will have a coloured specular reflection. Consider brass or gold for example. Semi-conductors are special, and are usually not found on macroscopic surfaces.

A physically based shader will take the material type into account when calculating the spectral reflection (ie. the intensity and colour of the reflected light).

Another thing to consider are layered materials. Almost all materials occurring in real life are layered to some extend. Consider a varnished wooden floor for example. The varnish is a clear, highly specular surface, while the wood underneath is a very diffuse one. The light first strikes the varnish layer, and specularily reflects back. The remaining light goes through to the wood and is partially absorbed and partially diffusely reflected. The amount of specular versus diffuse reflection in such a case is controlled by the Fresnel equations.

Plastic is another example. Plastic is composed of microscopic little dye bubbles embedded in a clear substrate. The light first hits this clear substrate before hitting the diffuse dye.

A lot of materials in reality are even more complex than that, and consist of several layers that interact. These can be approximated by sub-surface scattering shaders. Transparent or translucent materials extend this concept with introducing transmitted light and intra-material absorption. Also, some materials with very fine and regular surface elements may exhibit diffraction through light interference, which significantly changes the way specular reflection works (a CD or a hologram, for example).

Quote:
Original post by maya18222
3. If a surface is highly smooth, then specular reflection takes place and little absorbtion. Yet if a surface is fairly rough, then diffuse reflection takes place and more absorbtion, as shown below.



So what does it mean for a surface to be, in the "middle"? In that its not rough but its not smooth? To model this, would you LERP between a fully specular reflection ray colour and a fully diffuse ray colour, depending on how smooth the surface is?

A surface inbetween is often a layered or coated surface, as I explained above. In other cases, progressive blurring can be used. The rougher the surface, the more blur you apply to the reflection. For a fully diffuse surface, the blur would equal the radiance integral over the full hemisphere of 2pi steradians. That's the maximal possible 'diffuseness' in reality.

Quote:
Original post by maya18222
4. Why is it that surface and light descriptions also contain a specular colour parameter? Shouldnt the reflected ray colour be calcuated from the general light colour that the surface was struck with? why use a specular colour instead?

Because these models are only rough approximations. Physically based models will not separate these colours. They will expose a general roughness term (often over glossiness, which will integrate/blur the incoming light), the diffuse colour, the IOR (to compute the Fresnel term) and the type of material (dielectric or metal).

Quote:
Original post by maya18222
5. What causes a light ray to dimminish? From my understanding, it will dimminish as it is absorbed over multiple bounces within the enviroment. But if the enviroment was to contain infinitley smooth surfaces, does that mean the the light ray in thoery would be bouncing around indefinitely?

Correct, assuming we're in total vacuum (and ignoring certain quantum-mechanical effects).

Share this post


Link to post
Share on other sites
I guess you have missed something important,
first of the very first,
the lighting simulation in DX or GL are all of artifact one,
which means is an approach to the real light phenomena in exchange of speed boosting in real-time rendering.

Specular or Diffusion,
is just a term for lighting properties.
Specular happens everywhere accompanied by diffusion,
as i said,

Light is penetrating, reflecting, refracting and even some are attenuating, disappearing without no reasons(YES it can be, where photon strikes another particle and either positron or electron are emitted). Such electron are then reflected or refracted into our eyes and before it reaches, there's another probability such that two particle, either positron or electron will again merge and become photons (light particle), so it appears nowhere.

So in real-world, all things combined to happen together,
it is just from macroscopic view that diffusion is distinct from specular and yet they are actually the same phenomena accompanied.

If you would like to know more,
dive into Quantum theory and you will understand.

Share this post


Link to post
Share on other sites
I can really recommend you to write your own path tracer (or something similar). A path tracer is (to some degree I guess, I'm not into quantum theory) very realistic and you get a good feeling for everything you asked.

Share this post


Link to post
Share on other sites
You might also read about micro facette theorie which might explain your
problem considering diffuse vs specular reflection.
Remember that those equations like Phong/Blinn try to simulate the microscopic
behavoir of a surface by characterizing it macroscopic with some sort of
probabilities. They use numbers expressing the distribution of possible
reflecting microfacettes for your direction assuming a perfect surface.

Another point is, that almost every renderer works in rgb values rather than
true lightcolor by frequency.

Considering all I said before I would recommend you to read Christophe Schlick's
specifikation of his lightmodel. It is very modular thus easy to extend and has
capabilities for multi-layered surfaces, microfacette theory, anisotropy and many
more.

Share this post


Link to post
Share on other sites
Thanks to Yann and others for their replies. This kind of thing really interests me, and so I have ordered the book Physically based Rendering. Are there any others you'd recommend?

But regarding your replies.

Quote:
I can really recommend you to write your own path tracer (or something similar). A path tracer is (to some degree I guess, I'm not into quantum theory) very realistic and you get a good feeling for everything you asked.


Ive always wanted to do this, and plan to.

I guess you have missed something important,
first of the very first,
the lighting simulation in DX or GL are all of artifact one,
which means is an approach to the real light phenomena in exchange of speed boosting in real-time rendering.[\quote]

Nah, I'm fully aware, that most shaders are a crude approximation. My point was, which I didnt make very clear, the confusion in reading about shaders, where the authors dont usually mention what actually happens in real life. For example I have several books that all explain exactly how specular and diffuse reflection work in regard to their simplified shader models of these phenomona, but not much at all about how the shader would be written if it was somewhat physically correct, and the implications it would create.

Share this post


Link to post
Share on other sites

Quote:
I guess you have missed something important,
first of the very first,
the lighting simulation in DX or GL are all of artifact one,
which means is an approach to the real light phenomena in exchange of speed boosting in real-time rendering.[\quote]

Nah, I'm fully aware, that most shaders are a crude approximation. My point was, which I didnt make very clear, the confusion in reading about shaders, where the authors dont usually mention what actually happens in real life. For example I have several books that all explain exactly how specular and diffuse reflection work in regard to their simplified shader models of these phenomona, but not much at all about how the shader would be written if it was somewhat physically correct, and the implications it would create.



It's good you are aware of it, but not completely i guess?
Because these authors( to some extent),
some dive deep enough to know light's properties,
while some may not.
So in order not to confuse the readers with no strong physics background,
they rather excluded the theoretical parts.

Hope you enjoy in light's simulation.
Cheers.

Regards,
Daniel.

Share this post


Link to post
Share on other sites
Quote:
Original post by zurekx
I can really recommend you to write your own path tracer (or something similar). A path tracer is (to some degree I guess, I'm not into quantum theory) very realistic and you get a good feeling for everything you asked.


Actually, the OP question has little to do with the specific light transport algorithm used. The key point is wich surface description you are using: physically based BRDF's would give a better description of the different materials.

Share this post


Link to post
Share on other sites
Let's just clear this up.

For most computer graphics purposes, this...

...is wrong. It's okay for rough metals, but when we're talking about diffuse+specular shaders, we're talking about dielectrics.

When a ray meets a dielectric, some of it will be reflected (as per Fresnel's equation) and the rest will be refracted into the dielectric.

Beneath the surface, if it's an homogenous, clear substance like glass or water, the ray will keep going in the same direction, gradually diminished by linear absorption until it comes out the other side.

If it's a porous or inhomogenous substance (like plastic, wood, marble, concrete etc.), the ray will wander around, deflected many times by interfaces between particles of different IORs, and whatever isn't lost to absorption will eventually find its way out again, in the general direction of the surface normal.

That's what we see as 'diffuse' illumination. It's not scattered at the surface - it's scattered underneath the surface. Some wavelengths are absorbed more than others, so what comes back out after this sub-surface scattering will be tinted differently to the specular reflection.

And yes, in case you're wondering, the implication is that 'diffuse' and 'sub-surface scattering' are exactly the same effect, in reality. In computer graphics, diffuse is just a cheap & handy approximation of large-scale sub-surface scattering. If you don't believe me, take a thin sliver of any dielectric (ie: non-metallic) material and hold it up to the light.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!