The Science Of CG

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

REPLY TO THREAD
 
Thread Tools Search this Thread Display Modes
  10 October 2008
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?

Last edited by mister3d : 10 October 2008 at 09:09 PM.
 
  11 November 2008
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%.
 
  11 November 2008
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.

Originally Posted by mister3d: 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).

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.


Quote: 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.



Quote: 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.

Quote: 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.


Quote: 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'.

Quote: 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.

Quote: 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.

Quote: 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.
__________________
VFX Artist
// OSL Shaders //
 
  11 November 2008
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).
__________________

You can have your characters photoreal, fast or cheap. Pick two.
 
  11 November 2008
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.
__________________

You can have your characters photoreal, fast or cheap. Pick two.
 
  11 November 2008

Last edited by mister3d : 11 November 2008 at 11:58 AM.
 
  11 November 2008
Playmesumch00ns, great explanations! I finally start to understand what BRDF is! Also all the microstructure explanation is very good to me!

Originally Posted by playmesumch00ns: 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).


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. 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.




Originally Posted by playmesumch00ns: 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.


Which results in reflected and refracted caustics.

Originally Posted by playmesumch00ns: 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.


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.

Originally Posted by playmesumch00ns: 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.


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?

Last edited by mister3d : 11 November 2008 at 01:31 PM.
 
  11 November 2008
Originally Posted by mister3d: Playmesumch00ns, great explanations! I finally start to understand what BRDF is! 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. 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.







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

Quote: 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.


Quote: 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.

Quote: 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.
__________________

You can have your characters photoreal, fast or cheap. Pick two.
 
  11 November 2008
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.
__________________

You can have your characters photoreal, fast or cheap. Pick two.
 
  11 November 2008
Playmesumch00ns, thank you for the explanation, for the fresnel effect especially.
 
  11 November 2008
Originally Posted by mister3d: 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?


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.
Quote: 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.

Quote: 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.



Quote: 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.


Quote: 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? 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.



Quote: 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.

Quote: 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.


Quote: 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.


Quote: 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.


Quote: 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.
Yeah you'd have to make the metal sheet insanely thin to even see it, like gold leaf.



Quote: 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.



Quote: 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.


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

Quote: 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.
__________________
VFX Artist
// OSL Shaders //

Last edited by Rens : 11 November 2008 at 01:07 AM.
 
  11 November 2008
Originally Posted by Rens: No, your total reflection should be no more then 80%. So 'diffuse' + 'reflection' ≤ 0.8.

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%?


Originally Posted by Rens:
Actually the names 'diffuse' and 'reflection' are a bit confusing as they're both reflected or bounced light. However with paper the 'diffuse' part is always a diffuse reflection and the 'reflection' part can range between diffuse and specular reflection depending on how rough the surface is.


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?

Originally Posted by Rens: 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.


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?

Originally Posted by playmesumch00ns: Rens's explanation of what's going on in the paper case is very good. One thing I would add though is that you can't just use a fresnel function out of the box with rough surfaces. The reason is that the fresnel function only really works with perfectly specular surfaces. I believe maxwell gets around this by changing the frensel result with a curve depending on surface roughness. This curve is user-controlled. This is similar to what we do here: just reduce the 'strength' of the fresnel function for rough surfaces. As far as I am aware, there is no BRDF that simulates this effect in any meaningful (much less phsyically accurate) way. I'm not sure what parameters you might have in vray for being able to achieve the same thing.


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.
Attached Files
File Type: zip cg science.zip (22.6 KB, 51 views)

Last edited by mister3d : 11 November 2008 at 04:48 PM.
 
  07 July 2009
Smile

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)

Last edited by mister3d : 08 August 2009 at 05:20 AM.
 
  07 July 2009
Post

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)

Last edited by mister3d : 08 August 2009 at 05:23 AM.
 
  07 July 2009
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.

Last edited by mister3d : 08 August 2009 at 05:21 AM.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 10:35 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.