The Science Of CG


#61

Thank you Rens! Very good post, thank you for your contribution.
"Dielectrics:

  • First part gets absorbed, I guess most of it in the subsurface layer.
  • Second part gets bounced around in the subsurface layer which is inherently rough, so diffuse. Here part of the spectrum can be absorbed resulting in coloured light.
  • Third part gets bounced off of the surface, which can be rough or smooth… diffuse or specular. The spectrum stays pretty much how it is here, so white light stays white light."

But why some light gets reflected as specular reflection and some as diffuse for the same material? I thoght this happens as many materials are multi-layered. Does this happen as some rays hit the upper level of a microstucture and others penetrate deeper, bounce-bounce and then come back as diffuse?


#62

It would be interesting to discuss this on a microstructure level, meaning not what, but why it happens.

All I say here is very uncertain and I would love to hear from more knowligeable people.

Light can reflect as diffuse or direct(aka specular, what means Greek root “mirror”) reflection. There is also a glossy reflection which is a middle of both (maybe it’s a mix of diffuse and direct reflection, but the direct reflection is reflected from a less regular surface and reflects light in more that one direction(as in a case of direct reflection) of angle of incidence). Why is that on a microstructure level I don’t know. Perhaps if we imagine an irregular microctructure, it will have holes and peaks. The more dense the structure is, the more peaks are present and less holes. So striking the peaks reflects light in a direct manner as it doesn’t go inside of holes and bounces in them. The more polished the surface, the less holer are left to get diffused reflection(but it also depends on hardness of a material). For a specular, an angle of incidence equals the angle of reflectance. This means if you want to light a specular object, you can measure the angle visually and know where eactly position your lreflecting ightsource in relation to the camera.

Absorption
If surface is white, it reflects all wavelengths, if it’s colored, it reflects only color wavelengths of the color you can see. To you this means that some colored surfaces may not interact as readily to colored lighting as you would expect.
I’m not sure if absorption is a case of very pored microstructure, and light penetrates deeply and transforms into heat because it has a long way out. That’s why maybe it can’t be that all light rays go inside completely as there must be some peaks anyway in even a very pored microstructure. That’s why you should never set 0% diffuse(except from metals, as they don’t have a diffused reflection).
Does it mean that both microstructure and chemical compound(selective wavelengths reflection) affect the appearance of a materiial?

Transmission(transparent or translucent materials)
transparent on a mictostructure means light does not transforms into heat(black or dark material) and transmits the light directly. Translucent means light is diffused inside of a material. This maybe means its structure is less regular than of a transparent material(not sure at all). If the transparent or translucent material is colored, it will pass this color more readily then others. The complementary colors will not transmit at all.

Refraction. Refraction is the case of transmission. Refraction is a bending of rays as they transmitted from one medium to another. Different materials refract differently, it’s called an index of refraction. 0 IOR means the transparent object is not visible. This means light strikes the surface at a perpendicular angle to it. You can see glass only because of refraction of rays. The reason is the different density.Light travels slightly slower when passing through a densed medium. If you imagine a cast stone into water that if it strikes at right angle, it won’t change its direction. If at a steep angle, it will be more inert and will change the direction as it striked the heavy water. So that’s why when you look at a glass bottle you almost don’t see the front side and see the refracted siluohette.

Direct reflection only (conductors - metals): their molecular structure is so condenced (the molecules are very tightly spaced) that almost no particles of light can penetrate. Almost(80%?) ll the energy bounces-off of the surface of metal. That means there is no diffused value (or at least most of it?). No real subject produces a perfect specular reflection. Polished metal, glass and water nearly do so, but not 100%.


#63

Beh, can’t sleep.

Anyway, nice to see some more discussion going on about this stuff as it’s really hard to find good information on this topic the further along you go. This also means that I might be wrong about all of this but if so then I’d love to hear it.

Okay I get what you’re saying but you seem to have mixed up some words there. Diffuse reflection is reflected from a less regular surface, and specular reflection is reflected from a smooth surface.
Also the name ‘direct reflection’ can easily be confused with direct and indirect light, as in GI.

Why is that on a microstructure level I don’t know. Perhaps if we imagine an irregular microctructure, it will have holes and peaks. The more dense the structure is, the more peaks are present and less holes. So striking the peaks reflects light in a direct manner as it doesn’t go inside of holes and bounces in them. The more polished the surface, the less holer are left to get diffused reflection(but it also depends on hardness of a material). For a specular, an angle of incidence equals the angle of reflectance.

The way I see it a surface can be seen as little smooth plates stuck on a piece of land, following the surface. I’m just talking about what gets reflected from the surface right now. If you have a flat meadow or similar then the incoming light all bounces neatly away, specular reflection. If you’d have stuck the plates on a mountainside just after an earthquake all the plates would be pointing in different directions and so the light would be scattered all over, diffuse reflection.

Another interesting thing happens on the mountainside compared to the meadow, and that is after the light hits one of the plates it can actually hit another plate instead of bouncing away into the air. Which, if you take absorption and refraction into account again, will result in more light being transferred to the subsurface layer the rougher a surface is. Because on a smooth surface at micro level when a photon gets reflected off the surface it is gone. But on a rough surface the photon may, after surface reflection, have to go through the whole lottery again when it hits the surface another time and might then be absorbed after all.
I forgot the name but in a couple of specular highlight models this is actually a parameter.

This means if you want to light a specular object, you can measure the angle visually and know where eactly position your lreflecting ightsource in relation to the camera.

Yeah, if you mean when you want to know where to place the light so the highlight sits exactly where you want to. You can hold a pen laser alongside a camera and see where it hits and place your light there.

– Whoops, if you mean in 3D yea there are some scripts and tools around that do that.

Absorption
If surface is white, it reflects all wavelengths, if it’s colored, it reflects only color wavelengths of the color you can see. To you this means that some colored surfaces may not interact as readily to colored lighting as you would expect.
I’m not sure if absorption is a case of very pored microstructure, and light penetrates deeply and transforms into heat because it has a long way out. That’s why maybe it can’t be that all light rays go inside completely as there must be some peaks anyway in even a very pored microstructure.

The way I see it at micro level, not necessarily at quantum level, is that when light hits a ‘facet’ then depending on the angle of incidence it gets reflected out or gets sent in (refracted) into the subsurface. Absorption I assume happens mostly in the subsurface as it must be like a crazy pinball machine in there with all the light bouncing around and hitting everything.

Okay so lets follow the paths of a few photons.

Red plastic pen, rough surface.

  • Light hits a part of the surface at such an angle that it gets reflected out, landing on the back of your eyeball. No significant part of the spectrum gets absorbed, so colour remains the same.
  • Light hits a part of the surface, gets reflected out, but hits another part of the surface and, say, gets reflected out again. Same as above from here on.
  • Light hits a part of the surface and gets sent into the subsurface where it, after countless bounces, gets to escape with its life when it comes to the surface again and gets reflected out but unluckily finds its way into your eye. However the subsurface adventure caused most of the visible spectrum except the red part to be absorbed in the pen.
  • Light hits a part of the surface, into the subsurface, bounces around and gets absorbed completely.

Gold ring, smooth surface.

  • Light hits a part of the surface, gets reflected out directly, and into your eye. However because of the specific properties of metal a part of the spectrum was absorbed there, mainly the smaller wavelengths, which gives gold its warm colour.
  • Lights hits part of the surface and actually makes in into the subsurface layer. It won’t get far and it’s reeaally quiet there…

The interesting thing with metals is that if you take a really thin sheet of gold for example and put a bright white light on the other side you’ll see a little bit of green light coming through the sheet. This is odd because if you were to look on the side of the light source the gold would look yellowish again. I guess the green light would be the subsurface part, but there isn’t much of it around.
Compare this to a thin sheet of red plastic, it would look red on both sides. However this is because you see mostly the red subsurface part on both sides. Actually if the surface would be rough then the side where the light is on would look more pink (and would obviously be much brighter as well) because of the white reflection of the surface layer.
With metal you basically only see the surface part, which compared to dielectrics (non-metals) is much stronger but also can absorb a large part of the spectrum.

Oh yea, before I forget, a little bit on the Fresnel equation. So the smooth surface reflection part can be calculated with the Fresnel formula… the ‘fresnel reflection’. For dielectrics usually a simpler version is used which only uses the value n (your shader ‘IOR’ value) as its user input (incidence angle it gets from the renderer). For metals the full equation must be used which has two user inputs, n and k (spread), and also uses complex numbers. The simple equation basically keeps the k value at 0 which has the benefit of having only one parameter to worry about but you also won’t have to bother with complex numbers. The thing is that a k of 0 only works for dielectrics and can’t be used for metals which have varying k values.

Add to that the fact that not only different materials but also different wavelengths (!) of incoming light result in different n and k values, and you can see that it can get very complicated. This doesn’t matter much in dielectrics so luckily we can still simulate those pretty accuralty with only one value.
However it can be very noticable in metals and it’s things like this that give metals like copper different reflection colours at different angles (slightly more green at grazing angles).
So ideally for metals you’d need a table with n,k values for the whole visible spectrum range. Which finally explains why the single n or IOR value found next to metals in a lot of shader IOR lists is useless as you’d need at least the k value as well and preferably those two for each wavelength in the visible spectrum.

Most shaders I’ve seen use the single-value simple equation so that might explain the crazy values (>20) sometimes used as the IOR input to make it look somewhat like metal. But in the end if it looks good then it looks good, just keep in mind that, if you’re trying to keep things as physically correct as possible, that the simple equation is for dielectrics only.

That’s why you should never set 0% diffuse(except from metals, as they don’t have a diffused reflection).

Here’s a good example of where the term diffuse reflection and the diffuse shader parameter can be confused with eachother. Okay, so metal can have diffuse reflection as in it having a rough surface, but yes, in the case of smooth metal you’d leave the diffuse value 0.
However if you’d want to simulate a very rough gold object you’d set the shader’s reflection parameter to 0 and set the shader’s diffuse parameter to a yellowish colour. That would be much faster to calculate compared to say, raytracing ‘glossy reflections’.

Does it mean that both microstructure and chemical compound(selective wavelengths reflection) affect the appearance of a materiial?

Yes. Also the different (quantum level) interaction of light and matter between dielectrics and metals.

Transmission(transparent or translucent materials)
transparent on a mictostructure means light does not transforms into heat(black or dark material) and transmits the light directly. Translucent means light is diffused inside of a material. This maybe means its structure is less regular than of a transparent material(not sure at all). If the transparent or translucent material is colored, it will pass this color more readily then others. The complementary colors will not transmit at all.

Refraction. Refraction is the case of transmission. Refraction is a bending of rays as they transmitted from one medium to another. Different materials refract differently, it’s called an index of refraction. 0 IOR means the transparent object is not visible. This means light strikes the surface at a perpendicular angle to it. You can see glass only because of refraction of rays. The reason is the different density.Light travels slightly slower when passing through a densed medium. If you imagine a cast stone into water that if it strikes at right angle, it won’t change its direction. If at a steep angle, it will be more inert and will change the direction as it striked the heavy water. So that’s why when you look at a glass bottle you almost don’t see the front side and see the refracted siluohette.

I’ll have to read this part again tomorrow, but it might help to see refraction and transmission as having different values of subsurface roughness, compared to surface roughness which results in specular or diffuse reflections. So a milky glass has a rougher subsurface so to say than a clear glass.
Add to that a value to say how deep light can penetrate the surface, as I’m not sure if subsurface roughness alone would cut it, and with everything described above you have yourself a basic universal shader.

Say for a fully raytraced shader you’d have:

Surface:

  • Absorption (colour).
  • Roughness.

Fresnel switch between surface and subsurface.

Subsurface:

  • Absorption (colour).
  • Roughness.
  • Depth (?).

Think about it, you could get most materials with those parameters with a little layering and texture inputs… metals, plastics, glass, wood, even skin.
Plus you have the same parameters for all material shaders and you’d lose the annoying ‘diffuse’ and ‘reflection’ parameters.
Still, a simple setup like that would only work when you have brute force render power available… a la maxwell or path tracing. Which is why things like specular highlight models and lambert shaders exist in the first place.

Direct reflection only (conductors - metals): their molecular structure is so condenced (the molecules are very tightly spaced) that almost no particles of light can penetrate. Almost(80%?) ll the energy bounces-off of the surface of metal. That means there is no diffused value (or at least most of it?). No real subject produces a perfect specular reflection. Polished metal, glass and water nearly do so, but not 100%.

I think something around 95-99% could theoretically be reflected back from a polished metal, also depending on angle. Still, something like gold will keep a large chunk of the reflected light’s spectrum, which is why it looks like gold.


#64

Regarding specular highlight models, the mountain analogy Rens uses is quite good for one commonly used subset - microfacet models. Think of the surface microstructure like a mountain range modelled by a noise pattern (like in bryce or terragen or something). Increasing the specular roughness parameter of a BRDF raises the ‘height’ of those peaks.

Now imagine that mountain range being modelled out of quadrilaterals that are perfect mirrors. The sun is shining and we’re flying in a plane looking down on a single square-mile part of that range wiith a camera. A specular BRDF model is essentially calculating how many of those mirror facets reflect the sun’s light into our camera.

If you think about it, some of the mirrors will be in shadow from other peaks and so will reflect no light. Similarly other mirrors will be hidden from us because of other peaks blocking our view. These effects are known as shadowing and masking in the literature.

The clever part of these models is that they can calculate how much light ends up in our camera for a particular region given only the pattern used to model the range (called the distribution function), and the roughness parameter, using statistical methods.

The exact distribution functions used depend on the model. They are just simple functions describing how many of those microfacets point in a given direction, or what kind of “shape” the microstructure is. There is some evidence that real microstructures are closer to fractal in nature, but I don’t know of any BRDFs that can approximate this. I also don’t recall any BRDFs that actually account for multiple scattering events as Rens describes (i.e. light bouncing off one mirror, then onto another before bouncing into our camera).


#65

Terms like translucency are a bit of a pain in the arse too, simply because they’ve been used for years to describe very simplified approximations to rather complicated things. What people commonly talk about when they refer to translucency is subsurface effects. I’m not sure if there is a commonly accepted terminology for this, but I tend to use “subsurface reflection” for light that enters a surface, bounces around inside a bit, then exits back the way it came, and “subsurface transmission” for light that does the same but exits on the opposite side of the object.

What’s actually going on inside is rather complicated and is generally modelled as a random walk - i.e. the photon travels a short distance inside the material before it interacts with an atom and might be absorbed (or, to think of it another way, has some of its wavelengths absorbed), changes direction and does the same thing again many, many, many times.

There’s another “translucency” effect which you could call the “frosted glass” effect, properly known as diffuse or glossy transmission. This is caused by surface microstructure in the same way as specular reflection, except that the light is transmitted rather than reflected. In glass, once the light enters the material it doesn’t change much, so one could say there’s little or no subsurface effects, it’s just the surface effect that causes the frosted look.


#66

Thank you Rens very much for this enoumous input here.

You are right, to avoid the mixing up light and reflection names it’s better to use “specular reflection”.

You earlier said that diffuse and specular reflections are two diferent parameters both in life and in therefore in cg, which got me confused. From your microstructure explanation it seems it’s still the same parameter, as it’s the same kind of reflection but of different reflectance distribution quality. So why then a material with 0% diffuse 80% reflection with very glossy value, like, 5-10% may not be called “true” diffuse? Is it beacuse the fresnel falloff does not work for diffuse parameter?

Well, at least my arsorption explanation is similar to yours.
So we can say the following then: the light, if not reflected, goes through the surface, and if not transformed into heat, resulting in darker material(meaning no visible light information), goes through and out, which means transmission. Color is always a case of absorption either in transparent or opaque material, meaning selective wavelengths absorption. Black - all wavelengths are absorbed, white - all reflected.

Yeah, I just wanted to mention this at it is important for cg science to know if working with specular reflections.
Are there any tools like that you know for max? :cool: I was looking for something like this, but didn’t find.

Yeah, the light gets really crazy as it wants to go out. I would be too.

Dielectrics

[quote=“Rens”]

  • Light hits a part of the surface at such an angle that it gets reflected out, landing on the back of your eyeball. No significant part of the spectrum gets absorbed, so colour remains the same.

I guess you mean this is because the surface is not perfectly smooth, and where it hits the non-uniform part, it’s diffused, and where more uniform - specular part. So the last thing that is left is the light that goes through or stuck(absorbed)

That is importnant part! So colored material means light went through and was “filtered”. I thought before this happens on a surface level, but not subsurface.

I have nothing to add on this one, I agree.

Conductors.

If to follow your explanation, then dielectrics get coloured on subsurface level, i.e light is “filtered” after going through the material. With metals, it’s…the same?
I still don’t understand the diference between dielectrics and conductors regarding getting colured reflections: why metal gets colored specular or glossy reflection whereas dielectrics never get it colored, only the diffuse value?
Is it because, as you mentioned further, metals don’t have the subsurface part(being very rigid and therefore having very tight spacing of microstructure)?

You mean a very small percentage of it gets absorbed, that’s why it’s unlikely metal gets heated much exposed under direct light for a long time.

That’s interesting, I would never thought it may be so. This proves even metals have transmission, nevertheless they are known to be very rigid. The greenish color of transmission means that it absorbed all but not green wavelengths of light. Anyway, we don’t often simulate the transmission of metals. :slight_smile:

Good point! No need to go too crazy with “correct” values if the renderer is incorrect. :DI actually use the fresnel faloff for metals with less intensity for front and more for side values. :cool:
Playmesumch00ns nas noted that Fryrender and Maxwell conceptually closer to realworld calculations as they calculate the reflections for different wavelenghts(at least how I got it). From some tests that we ran here with other mambers on simple balls, maxwell really more realistic, that’s obvious.
It would be interesting to understand how the fresnel reflection looks on a microstructure level. As I understand it, on pored structure, you see more of microstructure elements along sides and they appear more dense there, because their spacing looks more dence at this angle. For metals, as the microstructure is very dense, we don’t see much difference in value. But as you say, even different wavelenghts appear differently in fresnel equations it may have different tint.

[quote=“Rens”]

Here’s a good example of where the term diffuse reflection and the diffuse shader parameter can be confused with eachother. Okay, so metal can have diffuse reflection as in it having a rough surface, but yes, in the case of smooth metal you’d leave the diffuse value 0.

Hold one, so you agree that my explanation was correct that “diffuse” shader parameter is simply a fake value? I don’t know if fresnel parameter must be used for a completely diffuse value(though nothing can be completely diffuse to mention)? theoretically.
For metals, as I understand, we usually don’t use the diffuse value as we need real reflections. The more difuse the surface is, the less real reflections matter. That’s why we mix “diffuse” shader parameter for dielectrics to more extent then for metals.

Is it about the coloured reflections?

For me the main problem I noticed when trying to explain fake diffuse and true raytraced reflection was that if we use only raytraced reflection, then the color of specular reflection will be coloured, as one peremeter will control both qualities. Though having a checkbox “metals\dielectrics” would solve this, or distinguishing both diffuse and specular reflection must be additionally done anyway.

Right, for clarity it must be explained as follows:
direct transmission(completely transparent)
diffuse transmission(milky look - is some light already absorbed? not sure)
selective transmission(colored glass - either direct or of diffuse transmission)

and for opaque materials oppose to:
direct(sorry, specular) reflection
diffuse reflection
selective reflection(only for metals - conductors) But why we see colored material for dielectics if it’s reflectin anyway? :surprised

Maybe we could talk about selective diffuse anв specular reflection, but why this differs for metals and dielectrics then it’s the same value I still don’t get.

[quote=“Rens”]

Say for a fully raytraced shader you’d have:

Surface:

  • Absorption (colour).
  • Roughness.

Though you explained formulas about fresnel parameter, I would love to hear how it’s related to surface and subsurface things. :buttrock:

Wow, looks like I begin to get it… Is it that color of dielectrics goes from subsurface and color of metals from surface? :bounce:

You see I was right - the diffuse shader parameter is fake. Maybe I was expressing myself not too clear an we got the wrong way of discussion there.

The same thing one guy creating his renderer told me, that a silver mirror will have 99% reflectance. So for metals it’s quite high, depending on it’s wear, oxidation, dirt… but never 100% or more, if to be pedantic.


#67

Playmesumch00ns, great explanations! I finally start to understand what BRDF is! :bounce: Also all the microstructure explanation is very good to me!

Considering that BRDF’s you are talking about are not the simplified models like lambert’s, phong’s and ward’s, it’s obvious that due to our computer capacities we can’t use even those calculated as quadrilaterals, so I personally don’t very worry about it. :smiley: This is important note though that even current BRDF models are just approximations.
By the way, in mental ray and vray there is a function called “roughness” for diffuse component, which is a bit strange to me as it is separate from reflection parameter… would like to know how to properly use it. I guess its value must be equal to reflection glosiness.

Which results in reflected and refracted caustics.

Do you mean that theoretically this also could be measured and using something like a BRDF? That gets really complicated if we try to get it “real”.
Somehow I thought that diffuse transmission canot happen without absorption, but I guess it’s just a diffused distribution of light rays, not nessesarily with absorption.

Do you mean that “frosted glass” effect happens to surface reflection level as it’s matted, whereas real translucency is the case of subsurface scattering?


#68

That roughness parameter is for the Oren-Nayar diffuse model, which simulates backscattering diffuse effects from dusty or “rough” surfaces.

Which results in reflected and refracted caustics.

No, caustics are caused by focusing. As you say they can be caused by reflective or refractive surfaces, but they are a specular effect. Subsurface scattering is a diffuse effect.

Do you mean that theoretically this also could be measured and using something like a BRDF? That gets really complicated if we try to get it “real”.
Somehow I thought that diffuse transmission canot happen without absorption, but I guess it’s just a diffused distribution of light rays, not nessesarily with absorption.

The Jensen/Donner multilayered BSSRDF does a reasonable job of highly scattering materials (e.g. organic materials like skin). You can’t simulate it with a BRDF because a BRDF by definition assumes that light enters and exits the material at the same point (a reasonable assumption for many surfaces). Path tracers like Maxwell et al don’t use a BSSRDF but simulate the random walk process directly to calculate subsurface scattering.

Whenever light enters a material, absorption occurs. How much depends on the material and how much light is scattered once it is inside the material. For example light tends to move through glass in a straight line without being scattered once it’s inside. This is why glass appears transparent rather than translucent. Absoprtion still occurs, just not very much, which is why the images you see through a glass object are slightly tinted.

Do you mean that “frosted glass” effect happens to surface reflection level as it’s matted, whereas real translucency is the case of subsurface scattering?

Yes. What we normally think of as translucency is caused by light bouncing around multiple times inside a material. The frosted glass effect, or diffuse transmission as I would call it, is caused by light being scattered onto a different direction at the surface of a material.


#69

Reading back over an earlier post of yours, you still seem slightly confused about the difference between surface microstructure and fresnel effects. The fresnel equations are essentially a statistical averaging of quantum effects i.e. interactions that depend on the atomic structure of the material. It’s not useful to think about “shape” of the surface at this level, as how light interacts at this scale is governed purely by the electromagnetic properties of the material.

This is why we have the split between conductors and dielectrics, because at a quantum level they behave very differently. So the electromagnetic properties of a material decide (basically speaking) whether a single photon is reflected, transmitted or absorbed, and at what wavelengths. This is what we model with the fresnel equations. The surface microstructure on the other hand decides the scattered directions of many photons. This is what we model with the BRDF.

I hope this makes sense.


#70

Playmesumch00ns, thank you for the explanation, for the fresnel effect especially.


#71
     Sorry, I was talking about the surface effect only in that paragraph. Let's put it this way:
Shader Property   VS   Real Material Property
	 

Specular			Surface Effect - Varying
Reflection			Surface Effect - Specular (Smooth)
Reflection 'Glossy'		Surface Effect - Somewhere between 100% Diffuse (Rough) and 100% Specular (Smooth)
	 
Diffuse				Subsurface Effect - Scattered
SSS / Translucency		Subsurface Effect - Scattered
Transparency / Refraction	Subsurface Effect - Clear
    Of course this is pretty generalised. The difference between the Diffuse and SSS/Translucency shader properties is the (subsurface) spread of the light, or how far from where the light enters the material will it exit the surface again. Light hitting a solid stone wall will exit the subsurface so close to where it entered that as far as your shader is concerned the spread is zero. Light hitting skin will usually exit a very visible distance away from where it entered, so this can't be ignored as skin will look 'dead' then, hence the need for Sub-Surface Scattering (!) shaders.

Materials have varying degrees of this spread. Grab a laser pen, grab some different materials of the same colour (white or the colour of your laser), and press the pen against the surface. In some materials you’ll see a glow around the pen and in others you won’t. Really, a laser pen is propably the most useful tool around if you want to learn about how different materials affect light.

Sorry, back on topic.

So why then a material with 0% diffuse 80% reflection with very glossy value, like, 5-10% may not be called “true” diffuse?

Because ‘true’ diffused light would mean an even spread, or lambertian distribution of the light. The Glossy shader effect will, as far as I know, always focus the light more in a particluar direction, namely the direction of the bounced specular reflection.
Ok, let’s say light hits a smooth surface, angle of incidence = angle of reflection. Take a paper fan and place it in the direction of the reflection. Image the paper fan is the beam of reflected light. If you open or spread out the fan a bit you would have ‘glossy’ reflection, if you open the fan to 180 degrees (maybe a bit more?) you have ‘true’ diffuse reflection. The wider you open the fan the rougher the surface is.

Also, because the glossy effect focuses the light in the direction of outgoing specular reflection it is a surface effect, not a subsurface effect. So a shader with 0% diffuse value and 80% glossy reflection could only be a metal, not a dielectric.

Is it beacuse the fresnel falloff does not work for diffuse parameter?

As playmesumch00ns already very nicely explained, the fresnel equation can only be used in a shader when you have completely specular reflection. You can get a diffuse reflection effect with the microfacet/path trace approach (single photon) where you could use the fresnel equation.
If you mean the Diffuse parameter found in most shaders (area average - many photons) then you can’t use it directly.
However, in all photorealistic cases the fresnel effect should be used as a switch (mix ratio) between the surface and subsurface layers of a material. So you could have a Diffuse shader as a subsurface effect and mix it with a Reflection shader as the (smooth) surface part. The amount of each depends on the fresnel equation but always add up to 1.

Well, at least my arsorption explanation is similar to yours.
So we can say the following then: the light, if not reflected, goes through the surface, and if not transformed into heat, resulting in darker material(meaning no visible light information), goes through and out, which means transmission. Color is always a case of absorption either in transparent or opaque material, meaning selective wavelengths absorption. Black - all wavelengths are absorbed, white - all reflected.

      Yes, very nice. Except transmission would imply that it goes through the object and out, but of course it might also come out on the same side as it entered.

Yeah, I just wanted to mention this at it is important for cg science to know if working with specular reflections.
Are there any tools like that you know for max? :cool: I was looking for something like this, but didn’t find.
You might be able to use the Place Highlight tool found in max. I’ve seen some scripts around but they might’ve been for XSI instead.

I guess you mean this is because the surface is not perfectly smooth, and where it hits the non-uniform part, it’s diffused, and where more uniform - specular part. So the last thing that is left is the light that goes through or stuck(absorbed)

I was talking about a single photon there I think. As is it angle-dependent (fresnel) whether it gets immediately reflected or not. But what you’re saying is correct when you mean smooth when you say uniform.

That is importnant part! So colored material means light went through and was “filtered”. I thought before this happens on a surface level, but not subsurface.

For dielectrics absorption of certain wavelengths is mostly a subsurface effect. I’d say for metals it’s mostly a surface effect.

     If to follow your explanation, then dielectrics get coloured on subsurface level, i.e light is "filtered" after going through the material. With metals, it's..the same? 
     I still don't understand the diference between dielectrics and conductors regarding getting colured reflections: why metal gets colored specular or glossy reflection whereas dielectrics never get it colored, only the diffuse value?
     Is it because, as you mentioned further, metals don't have the subsurface part(being very rigid and therefore having very tight spacing of microstructure)?

It’s mostly a different quantum level effect, density might be a part of that as well. Metals still have a subsurface effect but it’s hardly noticable.
Yeah metals get their colour at the surface and dielectrics get theirs from the subsurface.

You mean a very small percentage of it gets absorbed, that’s why it’s unlikely metal gets heated much exposed under direct light for a long time.
No, metals still absorb light, I’m not sure where the actual absorption takes place but the split between light being reflected out and light being sent in or absorbed happens at the surface. Metal still heats up quite a bit in the sun. On a side note, rust isn’t pure metal anymore (oxydised) and will absorb and reflect light differently.

That’s interesting, I would never thought it may be so. This proves even metals have transmission, nevertheless they are known to be very rigid. The greenish color of transmission means that it absorbed all but not green wavelengths of light. Anyway, we don’t often simulate the transmission of metals. :slight_smile:
Yeah you’d have to make the metal sheet insanely thin to even see it, like gold leaf.

It would be interesting to understand how the fresnel reflection looks on a microstructure level. As I understand it, on pored structure, you see more of microstructure elements along sides and they appear more dense there, because their spacing looks more dence at this angle. For metals, as the microstructure is very dense, we don’t see much difference in value. But as you say, even different wavelenghts appear differently in fresnel equations it may have different tint.

Yes that would be interesting and subtle things like that would probably be harder to simulate with a path trace approach compared to a BRDF shader based on measured data.

Hold one, so you agree that my explanation was correct that “diffuse” shader parameter is simply a fake value? I don’t know if fresnel parameter must be used for a completely diffuse value(though nothing can be completely diffuse to mention)? theoretically.
For metals, as I understand, we usually don’t use the diffuse value as we need real reflections. The more difuse the surface is, the less real reflections matter. That’s why we mix “diffuse” shader parameter for dielectrics to more extent then for metals.

The thing is that as the Diffuse parameter is a lambert function it’s more suited for subsurface effects as the light is so scattered there that it usually comes very close to an evenly spread out distribution (=lambert). Light reflected from the surface is as far as I know never as scattered as light from the subsurface and therefore a lambert shader (Diffuse parameter) is less suited for metals as they have more of the surface effect.
So it’s best to use the Diffuse parameter as a subsurface effect only.

Again, you use the fresnel equation for determining how much light makes it into to subsurface and how much light comes from the surface of the material. This is also the case with metals, just keep in mind that you use the full equation here, and also that whatever is not reflected out from the surface can be considered absorbed, whereas with dielectrics some light still makes it out from the subsurface.

Is it about the coloured reflections?
Coloured surface reflections are one of the things caused by their different (quantum) properties, yes.

For me the main problem I noticed when trying to explain fake diffuse and true raytraced reflection was that if we use only raytraced reflection, then the color of specular reflection will be coloured, as one peremeter will control both qualities. Though having a checkbox “metals\dielectrics” would solve this, or distinguishing both diffuse and specular reflection must be additionally done anyway.

      Not sure I follow you there. You have surface and subsurface effects. There are different ways to simulate surface and subsurface effects depending on things such as roughness and transparency. You can have shaders that simulate surface and subsurface at the same time, such as a basic phong shader. Some more accurate than others.

Other shaders you’d use to simulate only one layer and then later on layer them together. Such as a lambert shader as the subsurface and a raytrace reflection shader as the surface layer and then mix with a fresnel shader.
Still, there’s nothing stopping you from using a lambert shader as the surface and a blinn shader as the subsurface layer and then mix it with a checker map, it just won’t be realistic.

Ok, I’ll finish this up later. Also thanks to playmesumch00ns, great posts.


#72

Now I completely got it (diffuse\direct reflection), though how to calculate the overall 80% of reflection is not clear to me. Let’s say your diffuse is 80%, and you use fresnel falloff with 20% reflectivity away from the camera. Ok, considering you view it at frontal part, you get only diffuse, and at more steep angle you get it added, so it gets to 100%?

Isn’t diffuse must have a degree of “diffusion\relevant speculatiry”, as direct reflection has? It can’t be uniform for all materials, isn’t it?

It’s interesting in which way the diffuse component would be calculated via a brute-force approach. I haven’t seen it anywhere. Is it implemented in maxwell and is actually raytraced?

Isn’t it the “roughness” parameter of diffuse component which I showed with animated teapots?

I am trying to organise everything was said here into a text file. Later I want to add some diagrams. If you can, please read it, correct some mistakes, add new notes (with different text color), if you want, of course.


#73

Ok, it’s almost finished. One year of hard work…

Special thanks to 2 guys, who greatly contributed for creating this thread: Rens Heeren, and playmesumch00ns. Without them this thread definitely woudn’t exist, as they provided the most of scientific information.

Using physically correct route is a sign of an experienced cg-specialist.
Doing things in the physically correct way (or as close to it as understanding of physics and maths allows) means that the results are predictable.
Layering artistic hack after artistic hack into shaders quickly results in setups that are unmanageable and hard to make changes to. Moreover, if you don’t light those materials in exactly the right way (as the original shader designer intended) the results can often be bizarre or just plain broken. This is especially important when you need to share shading and lighting setups between multiple artists working on different shots and sequences.
Try to keep physical correctness for as long as possible and only branch off into ‘artistic licence’ when you absolutely have to. It makes sense studying photography and traditional lighting to know how to break the rules without breaking the physical rules.

The best ways to achieve the worst cg:
Don’t use GI – leave completely black shadows. You can also overexpose the direct light to the bulk for a blown-out look.
Leave procedural shaders, don’t map anything. Or use simple tiled textures.
For materials, use the extremes: 100% white, 100% black and 100% saturated colors where possible.
Don’t use reflectivity for materials and don’t make maps for it.
If you do use reflections (for some bizarre reason), use mirror-like ones, don’t blur them.
Ignore such thing as fresnel falloff.
Ignore bump or displacement, pretending that the simple, absolutely even surface geometry you create exists in the real world
Turn on the ambient lighting and don’t use the inverse square falloff for lights, except for the sun and the moon. Ignore the scale of the scene.
Use hard shadows always.
Don’t use real world camera options. Ignore exposure, depth of field and never use motion blur for animations.

Using these rules guarantees you quite plain cg.

Those are the most common mistakes by beginners, and should not be treated as a rule to avoid. Actually all of them can be ignored for some aesthetical or technical reasons, but with caution.

In raytracing the calculations are physically-based(mimic in a realistic way, but still not physically precise of course), that’s what they say in manuals for raytracers.
You cannot study lighting without concerns about materials and real-world cameras, because in realistic rendering we simulate photography and movie production. We do not simulate what our eyes see.

Geometry and geometry simulation considerations:
Geometry of most models cannot simulate real-world objects geometry and microstructure. To model every detail makes no sense – too hard to rig and map, also too heavy for viewports, so we use displacement or bump. Always use bump, or better, displacement for every surface, if you want a realistic result. At least in every cg movie production they provide at a MINIMUM color, bump (or better, displacement), and specular (reflection) for every surface. Yet to notice, they have hand-drawn textures for all of these components, not just values.(Pic)

There is one thing that concerns hard-surface modelling but is related to lighting - fillets. They are added to create highlights from lights and therefore enhance the feeling of form.(pic)

But think about the actual scale of fillets when adding them. Don’t do a 10 meters fillet on a distant building for a fancy highlight, add fillets with a realistic scale.

The law of energy conservation: any reflected value cannot be stronger than at the start, so reflection most probably will be a bit dimmer, and so is lighting has an inverse-square falloff. The silver mirror reflects 99% of light though. You should never reflect more light than you recieve.
Also the brightness also must be neither 0, nor 100% as the law of energy conservation applies. Usually you set your diffuse value around 20-80% for dielectrics, but 0% for metals. Your color saturation is also not 100%, but around 80%, as it’s probably cannot reflect 100% of light. (pic)

Light
There is a direct and indirect lighting. A direct lighting is just a ray that hits a surface but stops there, so we have no light bounce. That’s what never happens in real world.(pic)

Of course, for aesthetic reasons you can have completely black shadows, but it goes beyond this discussion.

The inverse-square light falloff: doubling the distance between the light and the subject results in one quarter of the light hitting the subject.

The light perspective: the more distant light is, the less obvious is the inverse-square decay. If you double the distance of the light source from the object, you must set its intensity 4 times brighter to appear of the same intensity, but the falloff range will be bigger. So the sun is so distant and so big, that using the inverse square falloff for it doesn’t make sense, so we neglect it – we use no decay for direct sunlight, moonlight and starlight. The difference may be obvious at different planets of solar system, but not on the Earth.
And this brings a very important note - the realistic scale of a scene is important, because light decaying in a realistic way is tied to the scale by its strength.(pic)

The inverse-square specular falloff: if you move the light closer to the specular(not glossy) reflection, it will appear bigger, but not brighter. This is because by doubling the distance you quadruple the area of highlight and the specular intensity scatters over 4 times bigger area, though becoming 4 times brighter.
Also, a small glossy reflection may appear brighter than a specular reflection: the area is spread-out, though the small soncentrated area it occupied before was brighter, but we can’t see it due to limited dynamic range)
(pic)

The angle of incidence equals the angle of reflectance (pic). This means if you want to light a specular object, you can measure the angle visually and know where exactly to position your reflecting lightsource in relation to the camera so it’s visible in reflection. There is a utility in 3ds max called “place highlight”, and perhaps other 3d programs have similar tools.
(pic)

Light distribution. In real life light diffuses most of the time, it’s really rarely you can see sharp shadows or a sharp cone from a spotlight. But when you create a spotlight in 3d software, usually it has a 1\1 rate of hotspot\falloff, which is wrong. It should have a rate of 1\10, and you get a more soft falloff which is correct. Just compare it with an area light which is a perfect example how realistic light works.
(pic)

Light shadow may be sharp or diffused depending on the size of a light source. Use soft shadows most of the time and you will make no mistake. Though in many beginner’s works you can see a car on a mirror-like surface with a harsh shadow.(pic)


#74

There is also an air perspective: objects dim with distance because air contains small particles of dust etc. It should be present in realistic outdoor (and often indoor) scenes as long as it is physically-based.(pic)

Overbright problem : In very bright areas a rendered image might look too saturated, which is not correct and should be corrected in postwork, either in photoshop or in a compositing program. In photographs shadows are saturated but the more bright the luminance the less saturated the colors a(pic)

When a photon hits a surface, one of 3 things happens (at least that we typically model in CG):
Reflection
Transmission.(transparency and translucency, also subsurface scattering)
Absorption (looks like no light information - black)

Objects can also emit light, which is emission.

(pic)

There are 2 types of material as far as we’re concerned:
conductive materials (metals)
dielectrics (everything else).
(pic)

When light is reflected or went through a material and went out, those effects happen:
If a light bounces off a diffuse surface a color-bleeding happens.
If a light bounces off a specular surface a caustics reflection happens.
If a light travels through a refracted surface a refracted caustics happens.
If a light is absorbed by a surface and leaves from the opposite direction, a subsurface scaterring happens.
(pic)

Caustics are caused by focusing. They can be caused by reflective or refractive surfaces, but they are a specular effect. Subsurface scattering is a diffuse effect, so light which goes out from subsurface-scattered material is subsurface transmission and if exits from the same direction as it went it’s subsurface reflection. (pic)

Depending on a surface quality, reflections are divided into:
Specular reflections (very smooth surfaces) – surface effect (specular means Greek root “mirror”)
Glossy reflections (in between diffuse and specular)
Diffuse reflections (rough surfaces) – subsurface effect
(pic)

Selective specular reflections are possible only for metals, which results in tinted reflections. Conductors (metals) don’t have subsurface reflection, only specular reflection.
(pic)

Selective diffuse reflections are possible for dielectrics, which results in colored surface quality.
(pic)

Transmission can be:
direct transmission (completely transparent)
diffuse transmission (translucent materials – milky look)
(pic)


#75

selective transmission (colored glass - either direct or of diffuse transmission) This kind of surface absorbs, reflects and transmits some of the light. It scatters light rays in many directions as they pass through.
(pic)

Not a surface completely absorbs (completely black), completely reflects or transmits. Every surface reflects, transmits and absorbs to some extent.

  1. Reflection. The photon bounces off the surface. Whether a particular photon is reflected, transmitted or absorbed by a material isn’t down to the surface microstructure, it’s down to its interaction with the atomic structure at the interface. I don’t know nearly enough about quantum physics to say any more than that, but I don’t think trying to qualify what’s happening in terms of structure is helpful. Metals do, for instance, transmit light, just tiny amounts at very short distances (gold leaf clearly transmits light).
    Dielectrics always reflect light exactly as it hit it, i.e. their reflections are “white”, whereas conductors will colour their reflections. What colour the reflected light is tinted by a conductor is dependent on its chemical makeup as well as the angle at which the light hits it. For instance light hitting a gold surface at a glancing angle is less yellow once reflected than light hitting the surface head-on.
    Specular (direct) reflection may be isotropic or anisotropic. An anisotropic specular is stretched-out in a direction perpendicular to the grooves in the surface, whereas isotropic is evenly distributed. The raytraced reflection usually gets stretched, not only the CG hightlight.
    Specular CG highlight
    (pic)

    Raytraced anisotropic reflection
    (pic)

Subsurface being the part that mostly gives the colour to the bounced light - the ‘diffuse’ part. The surface part is dependent on how rough the surface is, ranging from mirror-like to diffuse (lambert) reflection at the extremes.

BRDF
A real surface’s bidirectional reflectance distribution function (BRDF) describes how it reflects or absorbs light from different angles.
There are simplified BRDF’s (no raytracing), then hybrid (raytraced+simplified) and measured (complex, real-world surface data).
At the moment of the article the hybrid models are popular the most, measured are not yet available, though some renderers like Vray already have prototypes to work with it. There are not yet libraries of measured data available. Raytraced BRDF’s provide more reflistic result than simplified ones, and measured ones provide even more realistic result.http://www.youtube.com/watch?v=enjPuiA-MOE

Simplified BRDF
Simplified BRDF models are basically diffuse+specular, which means subsurface (diffuse) and surface (specular) reflection.
In the early days of CG there was no raytracing, so a raytraced lightsource reflection wasn’t an option. That’s why they came up with the idea of a specular highlight, which is fake. More and more people tend to use raytraced reflections instead of fake CG highlights, which gradually become obsolete.
This also reflects in lights in 3d programs: every modern renderer usually comes with an area light, which has a real reflection of the lightsource itself (because the renderer can actually render raytraced reflection), whereas old types of lights have no real reflection, they produce only a specular highlight. They are still useful though.
(pic)

The most common simplified BRDF’s for diffuse are Lambert and Oren Nayar.

Lambert (simple diffuse)
Lambertian is basically the “diffuse” color, or scientifically – a subsurface reflection. Other models deal mostly with specular (blinn, phong), which is usually added on top of lambertian.
Lambertian DRDF simulates a subsurface reflection as light, which first went inside of a material and went out into the camera lens with evenly spread out distribution (as definitely light had to bounce inside and cannot be mirror-like at all).Therefore it does not reflect the direct image of surroundings.
Surface reflection, on the other side, will never be as uniform as subsurface reflection, so it will always concentrate more light in the area of a bright object like a light source.
(pic)

Oren Nayar (diffuse for rough surfaces)
There is often a “roughness” function for “diffuse” (subsurface reflection). This is so-called Oren–Nayar Reflectance Model Its roughness parameter controls how much light is reflected back in the direction of the lightsource, which is a characteristic of “rough” (or dusty) surfaces. The more rough a surface is, the more the diffuse reflection flattens out. Roughness is generally not talking about BIG roughness, but very fine bumps on a surface. Stuff like velvet or skin can be considered to be rough, because at a very fine detail level, you have pores and the threads that make up the velvet. Something like plastic is far smoother at the microscopic level. Something like rubber, rock, rust, would have a much higher roughness than skin or velvet. Rough surfaces scatter light in many directions (but never quite evenly in all directions, this is a simplified representation).
(pic)

The most common simplified BRDF’s for specular are blinn, phong and ward. Those are specular cg highlights, simulating bright object reflections, like a light source.

Blinn (highlight, less distortion at glancing angles)
Blinn is a refined version of Phong. The blinn highlight, compared to phong’s, is much more capable of keeping its shape with the incidence angle…
Blinn is a cut-down version of cook-torrance with a cheap and ugly fresnel hack (the “rolloff” parameter).
(pic)

Phong (highlight)
Phong usually produces more stretched highlight at a glancing angle, whereas blinn’s stays the same.
(pic)

Ward-anisotropic (or simply “ward” – anisotropic highlights)
Ward is a decent, general microfacet specular model (like cook-torrance) that allows you to specify diffferent roughnesses in different directions, hence it’s anisotropic. Ward is the name of inventor, who invented anisotropy BRDF.
(pic)

Cook-Torrance (metals)
Cook-Torrance is a pretty great microfacet model. You can use different distrbution functions to get different shapes, including anisotropic

Lafortune is a multi-lobed model (i.e. it’s like 3 phong’s together), that is parameterised to allow you to “move” the position of each lobe as well as specify its roughness. By mathematically fitting measured BRDF data you can generate a fairly realistic representation of real-world materials.

The base shader is always a lambertian + either a blinn or a phong highlight.

There are other types, but they’re less common. Use your manual to inquire about particular used type.
Be warned: every renderer has their own definition for the above shading types. For example, max has something called Oren-Nayar-Blinn, which is an oren nayar shader with a blinn highlight. And lambert is usually the same as blinn except with no highlight. So things are very dependant on your 3d app.

While using “whatever looks right” is of course true, understanding what different brdf’s do and what they’re suited for is very important, if for no other reason than it gives you a head start in creating the surface you desire.
As computing power increases, the prevalence of physically correct rendering will increase too. Understanding the principles of shading is important for keeping the accuracy that will make your pictures look real.


#76

Measured BRDF
In real world the microstructure of surfaces is very complex, and currently used models for reflections are very simple and thus, unfortunately, not precise. In real life every surface has it’s unique microstructure (though some renderers, like Vray, already adopt the possibility to input the BRDF data).
On a microstructure level in real life (and in measured complex BRDF’s): Think of the surface microstructure like a mountain range modelled by a noise pattern (like in bryce or terragen or something). Increasing the specular roughness parameter of a BRDF raises the ‘height’ of those peaks.
Now imagine that mountain range being modelled out of quadrilaterals that are perfect mirrors. The sun is shining and we’re flying in a plane looking down on a single square-mile part of that range wiith a camera. A specular BRDF model is essentially calculating how many of those mirror facets reflect the sun’s light into our camera.
(pic)

If you think about it, some of the mirrors will be in shadow from other peaks and so will reflect no light. Similarly other mirrors will be hidden from us because of other peaks blocking our view. These effects are known as shadowing and masking in the literature. Even measured BRDF’s not yet take into account interreflection (a ray that first hits one plate, than hits another and finally hits the camera lens).

The clever part of these models is that they can calculate how much light ends up in our camera for a particular region given only the pattern used to model the range (called the distribution function), and the roughness parameter, using statistical methods.

The exact distribution functions used depend on the model. They are just simple functions describing how many of those microfacets point in a given direction, or what kind of “shape” the microstructure is. There is some evidence that real microstructures are closer to fractal in nature, but I don’t know of any BRDFs that can approximate this.
There is currently no single analytic BRDF model that can accurately represent all real-world materials; the Cook-Torrance model comes fairly close, but it is not very convenient to work with from a sampling point of view. It would be most accurate to use measured BRDF data, but even then, a certain number of approximations and assumptions are typically involved.

Reflection and refraction override diffuse. What that means is that if you have a highly reflective material such as metal, your diffuse won’t be seen almost at all. So 100% reflective=0% diffuse. 100% refractive - reflection is present, but no diffuse at all. Conductors (metals) do not have diffuse component, so for metals you set diffuse to 0%(black).
(pic)

All surfaces reflect. The least reflective surface known is having a 0.045 light reflectance http://forums.cgsociety.org/showthread.php?f=21&t=584234 . Most surfaces have a glossy reflection, mirror-like are rare.
The most reflective material available is Spectralon, which reflects about 90%(99%?) of incident light in a roughly lambertian fashion (but definitely NOT lambertian). A sheet of white paper is about 80% reflective.
Add mapped reflection to all materials without an exception if you want a realistic result.

Reflections are perhaps the second by importance factor of realism after global illumination (technically speaking, talent and experience is still valid)
Here is an illustration I did without reflection and added reflection. Look how much richer the second image looks.
(pic)

This is what archvizers use constantly - fresnel reflections.
Reflections in real world are mostly blurred, not mirror-like.
(pic)

The same about harsh and soft shadows. Use soft shadows most of the time and you will make no mistake. Though in many beginner’s works you can see a car on a mirror-like surface with a harsh shadow.

The darkest materials you find commonly sit around 3% iirc. You can produce materials which reflect as little as 1% of incident light, but you don’t find them anywhere except in a laboratory. The point is, surfaces reflect quite a lot. But reflections for dielectrics must have a fresnel falloff (read further about dielectrics).

  1. Transmission.
    Transparent on a mictostructure means light does not transforms into heat (black or dark material) and transmits the light directly.
    If the transparent or translucent material is colored, it absorbs selective wavelengths of light, and will pass its color more readily then others. The complementary colors will not transmit at all

(pic)

Whether light is transmitted or reflected at the surface depends on the angle at which it hits the surface and the index of refraction of the material. We model this using the fresnel equations. Essentially light that hits a dielectric head-on is almost certain to be transmitted, while light that hits at a glancing angle is almost certain to be reflected.

Only one of the above events can occur for any photon/surface interaction, but we’re modelling the net result of unimaginable numbers of these interactions, so for modelling a given surface we deal with the percentage of photons that undergo a particular type of interaction. So a metal might reflect 50% of the photons that hit it and absorb the other 50%, or we might model glass by saying that it transmits 90% of the photons that hit it dead-on, reflects 5% and absorbs the rest.
Even metals have transmission, nevertheless they are known to be very rigid. If you take a really thin sheet of gold for example and put a bright white light on the other side you’ll see a little bit of green light coming through the sheet. This is odd because if you were to look on the side of the light source the gold would look yellowish again. I guess the green light would be the subsurface part, but there isn’t much of it around.

Refraction is the case of transmission. Refraction is a bending of rays (changing their directions) as they transmitted from one medium to another. Different materials refract differently, it’s called an index of refraction, as well as the orientation of the surface relative to the light.
0 IOR means the transparent object is not visible (no bending of rays happens, both mediums are of the same density). You can see glass because of refraction of rays, and of partial absorption. The reason is the different medium densities. Light travels slightly slower when passing through a denser medium. If you imagine a cast stone into water that if it strikes at right angle, it won’t change its direction. If at a steep angle, it will be more inert and will change the direction as it strikes the heavy water. So that’s why when you look at a glass bottle you almost don’t see the front side and see the refracted siluohette.
(pic)


#77

There is also an index of reflective refraction and refractive refraction, which always equals (reflective refraction value is always the same as refractive refraction).
The IOR is actually exactly related to both Refraction and Reflection index in terms of both bending through the material as well as the energy of light and how that energy stops being absorbed by the material and when it starts to reflect it. Hence all materials (not just transparent ones) have an IOR value which deal with all levels of specular/reflective/refractive light. Therefore, if you want to be scientific about it, the values should be equal in both reflection and refraction. The numbers you can find in tables. Mental ray has both values controlled with the same fresnel input, whereas vray uses 2 different inputs.

Whenever light enters a material, absorption occurs. How much depends on the material and how much light is scattered once it is inside the material. For example light tends to move through glass in a straight line without being scattered once it’s inside. This is why glass appears transparent rather than translucent. Absoprtion still occurs, just not very much, which is why the images you see through a glass object are slightly tinted.

Translucency is the case of transmission.
Surface microgeometry can cause the light to scatter in multiple directions in a similar way to glossy and diffuse reflections. This causes effects like the transmission seen through frosted glass.
It might help to see transmission as having different values of subsurface roughness, compared to surface roughness which results in specular or diffuse reflections. So a milky glass has a rougher subsurface so to say than a clear glass. Add to that a value to say how deep light can penetrate the surface, as I’m not sure if subsurface roughness alone would cut it
On a microstructure level: translucency is subsurface effects. I’m not sure if there is a commonly accepted terminology for this, but I tend to use “subsurface reflection” for light that enters a surface, bounces around inside a bit, then exits back the way it came, and “subsurface transmission” for light that does the same but exits on the opposite side of the object.

What’s actually going on inside is rather complicated and is generally modelled as a random walk - i.e. the photon travels a short distance inside the material before it interacts with an atom and might be absorbed (or, to think of it another way, has some of its wavelengths absorbed), changes direction and does the same thing again many, many, many times.
What we normally think of as translucency is caused by light bouncing around multiple times inside a material. The frosted glass effect, or diffuse transmission as I would call it, is caused by light being scattered onto a different direction at the surface of a material.

Subsurface scattering is the case of transmission, and occurs when light enters a material (i.e. is transmitted), bounces around a bit inside, and exits at a different location from which it entered. The interactions inside the material cause some of its energy to be absorbed, usually different amounts at different wavelengths, so when the light exits it is dimmer and tinted. Subsurface scattering only occurs for materials that have a dielectric interface and is actually how every non-metallic material gets its colour (remember that dielectric reflections are always white). i.e. every time you see a coloured object that’s not a metal, the light has entered the material, bounced around a bit becoming coloured in the process, then left the material again at a different point. Thankfully, most materials are so hard that the entry and exit points are almost identical and we can pretend that they are so.
Measured BSSRDF’s: the Jensen/Donner multilayered BSSRDF does a reasonable job of highly scattering materials (e.g. organic materials like skin). You can’t simulate it with a BRDF because a BRDF by definition assumes that light enters and exits the material at the same point (a reasonable assumption for many surfaces). Path tracers like Maxwell et al don’t use a BSSRDF but simulate the random walk process directly to calculate subsurface scattering.
The difference between the Diffuse and SSS/Translucency shader properties is the (subsurface) spread of the light, or how far from where the light enters the material will it exit the surface again. Light hitting a solid stone wall will exit the subsurface so close to where it entered that as far as your shader is concerned the spread is zero. Light hitting skin will usually exit a very visible distance away from where it entered, so this can’t be ignored as skin will look ‘dead’ then, hence the need for Sub-Surface Scattering (!) shaders.

There is also dispersion, which is a split refracted light. Dispersion is caused by the the tendency of materials to refract different wavelengths of light to a different degree, causing rainbow-like colour effects (such as rainbows, for instance ). It is actually quite a common effect, you can see dispersed caustics through water and diamonds. For instance, and Newton famously used a common glass prism to split light.
Dispersion produces dispersed caustics(not sure about this last term).It looks like a colored refraction http://farm1.static.flickr.com/45/1...ed79d4b.jpg?v=0
and colored caustics http://www.moissaniteco.com/include…-dispersion.jpg
Dispersion is caused by the the tendency of materials to refract different wavelengths of light to a different degree, causing rainbow-like colour effects (such as rainbows, for instance).

  1. Absorption. The light energy is converted to heat energy and is ‘lost’. Of course it isn’t really lost, but in rendering we’re only concerned with light and not heat. In practice this means that no material should ever be 100% reflective if you want things to look real.
    If surface is white, it reflects all wavelengths, if it’s colored, it reflects only color wavelengths of the color you can see. To you this means that some colored surfaces may not interact as readily to colored lighting as you would expect.
    On a smooth surface at microlevel when a photon gets reflected off the surface it is gone. But on a rough surface the photon may, after surface reflection, have to go through the whole lottery again when it hits the surface another time and might then be absorbed after all.

When the light is absorbed by a surface, it appears darker. Black material means that its microstructure is pored and light goes through it and transforms into heat (dark clothing always gets hotter than white). That’s why the darkest material invented is carbon fibers structure. So 100% black means 0% reflection off the surface, and this never happens in real life: the structure cannot be so pored that no light reflects from it at all. All materials reflect to some extent.
Color is a result of selective absorption, and selective reflection.
Surfaces appear colored because they absorb some wavelengths(the color you don’t see) and some reflect(the color you see). So 0% diffuse (black) won’t reflect any light at all whatever intensity light is, because you tell it absorbs light completely. That’s why you should never set it to 0% diffuce (black diffuse) if you are doing a very dark material(unless you want a black hole there). There’s also an artistic reason for not using completely black diffuse for dielectrics: it makes the form to disappear and look like a hole in the picture.

So we can say the following then: the light, if not reflected, goes through the surface, and if not transformed into heat, resulting in darker material(meaning no visible light information), goes through and out, which means transmission, or it might also come out on the same side as it entered. Color is always a case of absorption either in transparent or opaque material, meaning selective wavelengths absorption. Black - all wavelengths are absorbed, white - all reflected.

Conductors (metals)
Metals don’t have a diffuse component as they don’t subsurface scatter light (or so little it can be ignored). They produce only specular reflection. And metals tint direct reflection, whereas dielectrics do not, as there’s much more absorbance of certain wavelengths with the surface reflection. That’s why you can have coloured specular reflections with metals that you can’t have with dielectrics.
Metals bounce off much more light as their microstructure is very rigid, not allowing light photons to penetrate too much, that’s why metals are so reflective (and hard).
Metals don’t have a higher index of refraction than non-metals. Gold for instance has a real ior of ~0.47. The difference is that they have a large complex part to their index of refraction, which dramatically changes the shape of the fresnel curves. It just so happens that putting a very high value (20-1000) into the real part of the fresnel equations while leaving the complex part at zero gives you a similar curve to proper complex fresnel. This is, I guess, why the Maxwell docs suggest using these values for metals (even giving some bullshit about it being because metals are ‘denser’), which as far as I can see is completely bogus.

With metals light either gets absorbed or gets reflected off the surface. The amount of light bouncing around under the surface and coming back out is so little it can be ignored. Also with metals there’s much more absorbance of certain wavelengths with the surface reflection. That’s why you can have coloured specular reflections with metals that you can’t have with dielectrics.
No real subject produces a perfect specular reflection. Polished metal, glass and water nearly do so, but not 100%.
For dielectrics absorption of certain wavelengths (it looks like color) is mostly a subsurface effect. For metals it’s mostly a surface effect.

The fresnel reflection for dielectrics vs conductors
The fresnel rule also applies to metals, but make sure you use the full equation, not the simplified one used to speed up calculations for dielectrics. Here it gives you the ratio between reflected and absorbed light. Most shaders don’t use the complex fresnel function.
For dielectrics usually a simpler version is used which only uses the value n (your shader ‘IOR’ value) as its user input (incidence angle it gets from the renderer). For metals the full equation must be used which has two user inputs, n and k (spread), and also uses complex numbers. The simple equation basically keeps the k value at 0 which has the benefit of having only one parameter to worry about but you also won’t have to bother with complex numbers. The thing is that a k of 0 only works for dielectrics and can’t be used for metals which have varying k values.

Add to that the fact that not only different materials but also different wavelengths (!) of incoming light result in different n and k values, and you can see that it can get very complicated. This doesn’t matter much in dielectrics so luckily we can still simulate those pretty accurately with only one value.
However it can be very noticable in metals and it’s things like this that give metals like copper different reflection colours at different angles (slightly more green at grazing angles).
So ideally for metals you’d need a table with n,k values for the whole visible spectrum range. Which finally explains why the single n or IOR value found next to metals in a lot of shader IOR lists is useless as you’d need at least the k value as well and preferably those two for each wavelength in the visible spectrum.

But as long as most people can’t write a metal shader, setting the IOR value 20> will give a similar to complex metal fresnel reflection curve. The best thing would be if we have such equations automatically in our renderers, and probably they will appear with time.
(pic)

Dielectrics
Whether light is transmitted or reflected at the surface depends the angle at which it hits the surface and the index of refraction of the material.
Fresnel reflection falloff is a rate between surface (specular) and subsurface (diffuse) reflection
All dielectrics have fresnel reflection so you should always apply a fresnel falloff for their reflection.
First you increase the reflection of the surface away from the camera, and when reached the limit, you start increasing looking at the camera reflection.
The fresnel refraction coefficient controls proportions between the camera facing reflection and away from it. The higher the value of IOR, the less difference is.
The fresnel reflection differs from a straight falloff by its curve: it’s more gradual at the beginning and very steep at the end.
(pic)

The ratio (!) between the subsurface (diffuse) and surface (specular reflection) parts is determined by the fresnel rule. In the case of a smooth blue plastic in a white environment making the object look more white at low angles and more blue at high angles. As it’s a ratio between the two you can see how it can’t be larger than one.
Something like a town with white rooftops and blue streets. Viewed from a road some distance away you’ll seen only the white rooftops while flying over the town you’ll seen a lot more of the blue streets, but the amout of rooftops and streets stays the same.
The fresnel rule also applies to metals, but make sure you use the full equation, not the simplified one used to speed up calculations for dielectrics. Here it gives you the ratio between reflected and absorbed light. Most shaders don’t use the complex fresnel function.
The index of refraction controls how distorted reflection or refraction will look and for metals brightens the reflection a bit.
Specular reflections of dielectrics are never tinted.
With dielectrics part of the light coming in gets absorbed, it’s gone as far as CG is concerned.
The second part gets scattered in the subsurface of the material and actually makes it back out. Certain wavelengths get absorbed giving the colour to the material, like blue plastic. It’s close enough to being perfect diffuse to get away with treating it as a lambert function.
The third part is the part that gets bounced off the surface of the material while almost the complete spectrum is being bounced back.

The fresnel equations have nothing to do with microgeometry, it’s essentially a statistical averaging of quantum effects i.e. interactions that depend on the atomic structure of the material. It’s not useful to think about “shape” of the surface at this level, as how light interacts at this scale is governed purely by the electromagnetic properties of the material.
This is why we have the split between conductors and dielectrics, because at a quantum level they behave very differently. So the electromagnetic properties of a material decide (basically speaking) whether a single photon is reflected, transmitted or absorbed, and at what wavelengths. This is what we model with the fresnel equations. The surface microstructure on the other hand decides the scattered directions of many photons. This is what we model with the BRDF.

Adjusting the fresnel falloff:
First you start increasing away from the camera reflection (90 degrees reflection), and only when reaching maximum, you start inceasing the facing the camera reflection (0 degrees reflection).

Cameras:
exposure
motion blur
depth of field
white balance
Those are essential. But there are many others, which are caused by effect filters, and so on and so forth.

Exposure is for how long a film exposes itself to light. Longer – brighter, shorter – darker images. The controls are:f-number (also controls depth of field), shutter speed and film speed (ISO). This is a crucial element of controlling the contrast and brightness in your renders.

Motion blur is caused by the shutter opened long enough so the moving object leaves a trace on the film. If you render an animation, it must be used always to avoid lugging. Animation without motion blur is a sign of unprofessional work. Usually it’s set at half a time per second.0,5). For stills it’s not as important, unless you want to show movement, or hide a lack of details.
Motion blur never has any kind of falloff, it’s always uniform. So you won’t have it more bright at the beginning and more dull at the end of the “tale”. This is important to remember if you are trying to simulate motion blur.

Depth of field occurs because a lens focuses light rays coming from a single point in a cone toward the film back. The length of this cone is dependent on the distance of the subject from the camera and the arrangement of the lenses in the camera. If the film back does not lie exactly at the apex of this cone, then the intersection of the cone and the film forms a circle (the circle of confusion). This essentially means that 3d points become circles when projected onto the film and the image becomes blurred.
(pic)

Depth of field is controlled mostly by f-number but also by the size of lens and film gate, and creates an effect of falling out of focus, which is very important for a realistic rendering as long
as in many shots such as macroshooting it must be present. In real life an extreme depth of field is desirable to create the feeling of depth and is expensive to achieve.

A white balance Every light has a relative color temperature, but our eyes lie about it (and about many other things) because adapt very quickly and we see most lights as white. A white balance is a color temperature which will be taken as white, and hotter will be more blueish and cooler more reddish. http://www.mediacollege.com/lightin...temperature.gif
To illustrate the color temperature, the rule to me is that there are no rules. There are kelvins and lumens, but if you stick to them you are a robot, you should work with color. The general rule is that outdoor light are much brighter than indoor and there is a color of light sources. Some artists don’t use any color for sources. This is because when they look at a light they see it white because their eyes adapt quiclky. But if you take a shot you will see that there is not such a thing as white light (unless it is at the whitebalance point).
(pic)

Remember: color creates mood, and in films they use colored gels etc. so study film shots for color temperature and mood.
Though using white balance is beneficial in cg, as you can easily manipulate overall mood and color feel.

(the end)
And also there is a monitor physics: your software must have a proper calibration http://forums.cgsociety.org/showthread.php?f=2&t=188341 , a color temperature(6500k) and gamma-correction applied http://forums.cgsociety.org/showthread.php?t=610790 always.
All of these effects should be under your control(where, how and when) if you want a physically resalistic rendering. The next step is how you achieve them in your renderer, either with a more advanced algorithm (raytracing) or more fake-based(reyes).


#78

A couple of things:

  1. Reflections are never distorted in the same way as refracted light. The distortion due to refraction is (as you pointed out in your previous post) caused by light changing speed as it enters a different material, which obviously does not happen in a reflection.

  2. AFAIK “subsurface reflection” and “subsurface transmission” are commonly used terms. To be more technically correct you can use “back scattering” and “forward scattering” instead, respectively.

  3. I’m not 100% sure about the “diffuse colour is always subsurface reflection” thing any more. Certainly for many materials this is the case (anything organic and anything you can polish), but I don’t know if it’s correct for everything.

  4. Whether a particular photon is reflected, transmitted or absorbed by a material isn’t down to the surface microstructure, it’s down to its interaction with the atomic structure at the interface. I don’t know nearly enough about quantum physics to say any more than that, but I don’t think trying to qualify what’s happening in terms of structure is helpful. Metals do, for instance, transmit light, just tiny amounts at very short distances (gold leaf clearly transmits light).

  5. Metals don’t have a higher index of refraction than non-metals. Gold for instance has a real ior of ~0.47. The difference is that they have a large complex part to their index of refraction, which dramatically changes the shape of the fresnel curves. It just so happens that putting a very high value (20-1000) into the real part of the fresnel equations while leaving the complex part at zero gives you a similar curve to proper complex fresnel. This is, I guess, why the Maxwell docs suggest using these values for metals (even giving some bullshit about it being because metals are ‘denser’), which as far as I can see is completely bogus.

  6. Dispersion is actually quite a common effect, you can see dispersed caustics through water, for instance, and Newton famously used a common glass prism to split light.


#79

Thank you very much for the pointing out mistakes. Without you and Rens this thread wouldn’t exist. I learned so much from it, and I hope others too.
I found all mistakes you pointed out and fixed, except this one, which I couldn’t find:

Can you point out where it is in the text? Thank you.

It’s interesting to hear how you learnt so much about physics. :slight_smile: Did you learn it specially for CG? I know you write shaders for Renderman, did you study in some kind of CG university?

That’s interesting. In mental ray, if you set the reflection through fresnel curve, it changes it after some point like this.

Is it what you are talking about? So using usch a curve, like with IOR 30 is a better chioce for metals?


#80

Better would be to use a complex fresnel formula (n,k) instead of the simplified one (n). As for dielectrics the k is usually zero the simple form will do. I think that was mentioned a few pages ago.

I’ve written a complex fresnel shader in mr, it’s in XSI though, what program are you using mr with? Speed difference isn’t anything extreme so I don’t really know why nobody’s made one before. Let me see if I can post it in the next few days.

Still have a few things to contribute here if you don’t mind. Haven’t read anything the last few days but looks like you’be been busy.