CGTalk > Techniques > Lighting and Shaders
Login register
reply share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 09-04-2008, 11:38 PM   #46
stew
Lord of the posts
 
stew's Avatar
portfolio
Stefan Werner
Senior Software Engineer
Germany
 
Join Date: Aug 2003
Posts: 892
Quote:
Originally Posted by Dtox
On a slightly different subject, there might be some benefit to rendering to RAW files.

No, there would be no benefit. RAW is good for only one thing, and that is storing data directly from a camera sensor. The output you get from a renderer is very different than what a camera sensor gives you and converting the renderer's output to something similar to camera data would most likely reduce the quality.

Besides, there is no real standardized RAW format - every camera vendor stores it differently, even different camera models from the same manufacturer can have different interpretations of RAW. RAW does not store direct images, it stores just raw sensor data and nothing else.

OpenEXR so far fulfills all the typical needs in a digital pipeline.
 
Old 09-05-2008, 01:08 PM   #47
DecWest
Frequenter
 
DecWest's Avatar
portfolio
Ric Miskimmon
Senior Artist
SONY
Liverpool, United Kingdom
 
Join Date: Jun 2007
Posts: 142
This is an awesome thread gents. You have saved me hours of wikipedia research. Thanks!
__________________
VIMEO // LinkedIn
 
Old 09-16-2008, 12:23 AM   #48
dutchtilt
visual effects artist
 
dutchtilt's Avatar
josh herrig
Lighting Artist
Pixar
Vancouver, Canada
 
Join Date: May 2006
Posts: 100
Quote:
Originally Posted by Magnus3D
When you guys create your shaders, which approach do you use ? do you take the physically accurate route ? meaning that you try to find measured data that matches the material you're recreating and use them in the creation of your shader.

Or do you search for lots of referencematerials (images and text) about the shader you're reacreating and then simply eye out the fine details from those reference pics to recreate the look and feel of a material on your own ? let's call it the shoot-from-the-hip approach.


I just hit the "make it not suck" button
__________________
www.strangetoast.com
 
Old 09-26-2008, 06:10 PM   #49
bonestructure
Lord of the posts
 
bonestructure's Avatar
portfolio
Ron Leming
writer, artist
Burnt Popcorn Graphics
Amarillo, USA
 
Join Date: Feb 2005
Posts: 837
Send a message via Yahoo to bonestructure
"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 scenes as long as it is physically-based."

Oh that's the one I need badly to learn how to do
__________________
Keep this in mind when training animals: If you beat a cat with a loaf of bread, there is *no* way you'll ever train him to make you a sandwich!
 
Old 10-11-2008, 03:21 AM   #50
mister3d
Expert
 
mister3d's Avatar
portfolio
asdasd adsasd
Kiev, Ukraine
 
Join Date: Nov 2004
Posts: 6,031
Quote:
Originally Posted by Magnus3D
I didn't wanna start a new thread about this, so i add this question here instead.. if it's ok.

When you guys create your shaders, which approach do you use ? do you take the physically accurate route ? meaning that you try to find measured data that matches the material you're recreating and use them in the creation of your shader.

Or do you search for lots of referencematerials (images and text) about the shader you're reacreating and then simply eye out the fine details from those reference pics to recreate the look and feel of a material on your own ? let's call it the shoot-from-the-hip approach.

Which is your favorite method to use ? or do you use a completly different approach to this ?

/ Magnus


I have difficulties currently keeping the physically accurate route, because I have limited lighting knowledge. It's not about shaders but about keeping them of needed brightness\reflectivity. Keeping the physical accuracy is the sign of maturity and experienced cg artist to me. First of all, it requires certain, deeper understanding of lighting than just the renderer settings. To say that in real life they don't use hacks is not true, they do, but it's the last resort as is in cg. Let's say somebody lights a highly reflective mirror-like thing but there is a small details which just won't reflect whatever you try. You then spray it with some kind of substance that makes it more glossy and therefore it reacts to light more readily, Though if you spray all over the object it may show your inability to light mirror-like objects.
In cg. for example you light watches. You have your reflection part and diffuse part. What if you have your reflection of needed exposure but the diffuse looks too dark? The worst thing is to tweak the diffuse value itself. But if you know the physical laws, you know that reflection brightness does not change with distance. So you can simply move the light closer to the subject or increase its size.
Knowing this fact you can use a reflective bounce card and when moving the main light source away keeping the fill light approximately of the same intensity, because it's a reflective caustics.
The artist which introduced to me the real life lighting techniques is Christopher Nichols. He has very interesting demonstration of using bounce cards and such stuff fully utilizing GI and raytracing. Before this I thought "hm, why to study real life lighting if we are cg artists? We don't use this cumbersome stuff and we are completely different" I was so much wrong. When I asked him what could he suggest to read he suggested me a book which opened my eyes how much more vast the subject is than just cg tools. Those books can really improve the general approach to cg lighting and lead to sophisticated lighting approach, keeping the physically accurate route. I only wish that GI and raytracing techniques would be cheaper in terms of time than they are today.

Last edited by mister3d : 10-11-2008 at 04:37 AM.
 
Old 10-14-2008, 04:29 AM   #51
sundialsvc4
Lord of the posts
 
Join Date: Jul 2004
Posts: 1,429
I personally think that the answer to that question is easy... just "not 'obvious.'"

Let's face it: when the (virtual...) dust finally settles, what we are actually being required to produce is either...
  1. An image on cinema-sized film, or...
  2. An image on a video screen.
We are not being asked to produce "physical reality."

We know that our audience (each member of which is equipped with a stunningly-amazing biological data-processor known as "a human brain"...) will instantaneously correlate whatever-we-show-them with (their version of...) "physical reality."

Therefore, we are 'off the hook!'

We "merely" need to produce "an image that looks good," in whatever medium we are being asked to employ. We need to produce the image "by deadline," and we need to spend as few physical-dollars as possible doing it. But, beyond that, we are both "free" and "encouraged" to 'cheat.'

The tornado in Wizard of Oz was basically panty-hose. The alien-architecture in Star Trek was made from repainted cast-offs from "Mission: Impossible." And nobody cared. It was cheap, it was fast, it was good-enough, and it was "Cut! Print it!"

Last edited by sundialsvc4 : 10-14-2008 at 04:32 AM.
 
Old 10-16-2008, 01:54 PM   #52
mister3d
Expert
 
mister3d's Avatar
portfolio
asdasd adsasd
Kiev, Ukraine
 
Join Date: Nov 2004
Posts: 6,031
Quote:
Originally Posted by sundialsvc4
But, beyond that, we are both "free" and "encouraged" to 'cheat.'

The tornado in Wizard of Oz was basically panty-hose. The alien-architecture in Star Trek was made from repainted cast-offs from "Mission: Impossible." And nobody cared. It was cheap, it was fast, it was good-enough, and it was "Cut! Print it!"


I agree, but the question is in cheating quality. If you use cg tricks, you complicate the scene setup. Also in real life you already have a realistic scene. In cg you work from the opposite, and each time you break the rules you bias the rendering to the unrealistic result. In photography you start cheating from light position, light blocking and camera settings. Then you manage reflections and diffuse values by adjusting light blockers, changing the environment and camera position\settings. Anyone who is passed this scene on will have no troubles tweaking ti further. From another point, they use polariser fitlers to get rid of reflections, block lighting from producing speculars, spray with dulling or increasing specularity sprays, "paint with light" using long exposure to put the lightsource into the camera visible range but not visible in the final image, and even combine different exposures to make something like a collage. But not vice-versa. It looks like that there must be clearly defined workflow establishing what is more physically correct and less, and work from there.

Quality (imo) cheats:
by changing the light position and size of the lightsources
light blocking using gobos and adjusting the environment
managing reflections using gobos, camera position and environment
light diffusion using translucent, reflective planes(any substitutes imo are ok, like using mapped planes)
specular gobos

Those cheats are a bit "cheap" in cg:
light blocking using including\excluding from light
increasing\decreasing reflectivity of shaders even if you know it's correct
tweaking the diffuse even if you know it's quite balanced
turning off "visible to camera"(though "painting with light" technique can use lighting of a source withing the camera view, but it's not visible due to long exposure, but for stills)

Many people are interested in "unbiased" renderer Maxwell. I didn't use it, but from what I know it limits you to real life setups.
Probably using only cg tricks or completely omitting them in lighting is wrong, both are the extremes. Cg tricks are quite often possible in photography as photographers exist for a long time and developed their own arsenal of tricks to be free in artistic choices (up to retouching). But let's work from the ground up:
breaking physical laws is wrong. Those have been discussed already, but I will revise and reorganise the information soon.
If you can keep the physically correct route, keep it, but if you inevitably (debatable) need to hack, you can either:
use cg techniques
use photography hack techniques

Both require knowledge and experience, and perhaps only experience can tell what is more appropriate. But knowing both ways is a plus.

Last edited by mister3d : 10-16-2008 at 02:22 PM.
 
Old 10-18-2008, 08:24 PM   #53
shroomer
Veteran
OM
London, United Kingdom
 
Join Date: Jan 2008
Posts: 30
so how to set up material?

Quote:
Originally Posted by playmesumch00ns
Nice post misetr3d!

...These rules reflect what is known as conservation of energy: you should never reflect more light than you recieve. The situation is complicated somewhat by the way most renderers model materials. The usual way is to additively layer BRDFs (illumination models), i.e. have a diffuse and a specular section in your shader. You have to make sure that the sum of your diffuse and specular do not go to 1 in order to be physically plausible. Of course this is not the way real materials behave as we've seen above, but it makes the maths easier to handle things separately. As far as I know, the only renderers to handle things 'properly' are maxwell and fry.


hi guys,

thanks for the GREAT info. i have a question regarding the setup of materials in engines like vray. as an example, i will use a PAPER material. in an earlier post in this thread, it is claimed that a sheet of paper is 80% reflective.

assuming this is correct, how should i set up diffuse and reflective parameters (for simplicity, let us assume that no light is transmitted)? if reflection is 80%, does that mean that diffuse should only be 20%? if i render this way, the paper sheet comes out too dark...

a lot of times i see material setups on various websites and they have diffuse and reflection both set to 100%! surely this is incorrect?

any advice?

TIA
 
Old 10-18-2008, 09:43 PM   #54
mister3d
Expert
 
mister3d's Avatar
portfolio
asdasd adsasd
Kiev, Ukraine
 
Join Date: Nov 2004
Posts: 6,031
Quote:
Originally Posted by shroomer
hi guys,

thanks for the GREAT info. i have a question regarding the setup of materials in engines like vray. as an example, i will use a PAPER material. in an earlier post in this thread, it is claimed that a sheet of paper is 80% reflective.

assuming this is correct, how should i set up diffuse and reflective parameters (for simplicity, let us assume that no light is transmitted)? if reflection is 80%, does that mean that diffuse should only be 20%? if i render this way, the paper sheet comes out too dark...

a lot of times i see material setups on various websites and they have diffuse and reflection both set to 100%! surely this is incorrect?

any advice?

TIA


Your diffuse should not be more than 80% of brightness, but also your reflection must be very low and diffuse (for paper). This brings up an interesting thing: both diffuse and reflection are actually the same kind of parameter, but treated differently for the sake of speed. So saying that reflection overrides diffuse is just how cg software treats it as it should keep it no more than 1, that's why it overrides it. indeed it's the same reflection in nature, either diffuse, or glossy or specular. But as long as it's the same parameter, either should not be more than 80%.
In vray setting both to 100% doesn't make sense as if you set your reflection to 100% it doesn't matter what your diffuse value is as it's fully overriden. If it's less than 100%, than it mixes with diffuse, so if it dffers from black it interfers with your reflection (either for good or for bad, it's up to you).

Last edited by mister3d : 10-18-2008 at 10:00 PM.
 
Old 10-19-2008, 09:22 AM   #55
shroomer
Veteran
OM
London, United Kingdom
 
Join Date: Jan 2008
Posts: 30
thanks for the reply mister3d, but i'm still unsure on something.

Quote:
Originally Posted by mister3d
Your diffuse should not be more than 80% of brightness, but also your reflection must be very low and diffuse (for paper).

but if paper is 80% reflective:

Quote:
Originally Posted by playmesumch00ns
The most reflective material available is Spectralon, which reflects about 90% of incident light in a roughly lambertian fashion (but definitely NOT lambertian). A sheet of white paper is about 80% reflective.

then shouldn't i set the reflection parameter to 80% (glossy reflections of course) and set the diffuse to 20%. OR do i ignore the 'sum of light absorbed/reflected/transmitted = 1' rule and set reflection and diffuse BOTH to 80% (but therefore sum of light = 1.6)?
 
Old 10-19-2008, 10:01 AM   #56
mister3d
Expert
 
mister3d's Avatar
portfolio
asdasd adsasd
Kiev, Ukraine
 
Join Date: Nov 2004
Posts: 6,031
Quote:
Originally Posted by shroomer
thanks for the reply mister3d, but i'm still unsure on something.


but if paper is 80% reflective:


then shouldn't i set the reflection parameter to 80% (glossy reflections of course) and set the diffuse to 20%. OR do i ignore the 'sum of light absorbed/reflected/transmitted = 1' rule and set reflection and diffuse BOTH to 80% (but therefore sum of light = 1.6)?


I think you can set your reflection to 80%, but it must be pure raytraced reflection then. DIffuse value is fake, because it's not raytraced. Create a vraymaterial(or mental ray arch&design) and set its diffuse to 0%, then reflectivity to 80% and glosinness to 0,2(20%). This is the true raytraced diffuse.
It cannot be 1.6 in total, it's locked to be no more than 1(unless you tweak in the difuse map parameters without clamping). But for paper raytraced reflection is not as important as for chrome, that's why you kind of mix the true reflection onto fake diffuse value, at least how I understand it.

Last edited by mister3d : 10-19-2008 at 10:16 AM.
 
Old 10-19-2008, 02:44 PM   #57
Rens
rope folly
 
Rens's Avatar
portfolio
Rens Heeren
Senior Generalist
Singapore, Singapore
 
Join Date: Nov 2003
Posts: 1,938
No, your total reflection should be no more then 80%. So 'diffuse' + 'reflection' ≤ 0.8. Also in the case of paper diffuse and reflection are different parameters, both in 3D and in reality, it's not a speed issue.

What goes in must come out in some way, either (in the case of dielectrics...non-metals... paper) being absorbed or bounced back out of the subsurface or the surface layers. Subsurface being the part that 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... the 'reflection' part.

See it this way, 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.

With metals light either gets absorbed or gets reflected off the surface. The amount 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.


So for your shaders you should have the following.

Metal:
- First part gets absorbed.
- Second part gets bounced off of the surface, which can be rough or smooth resulting in resp. diffuse or specular reflection. A large part of the spectrum can be absorbed here resulting in a coloured reflection.

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.

Now the ratio (!) between the subsurface and surface 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.


So... assuming most light gets absorbed in the subsurface layer of paper you should set your vray diffuse colour to 80% white for perfect white paper. Set your reflection colour to 100% white but make sure you use the fresnel option in vray and use an IOR of around 1.4 I guess. Without the fresnel option it'll look like crap. Vray correctly uses the fresnel number as a ratio and so the visible light won't exceed one.
Now what's left is the roughness value, change it to get either diffuse or specular reflection.
Use maps for the diffuse colour and for the roughness as well to make it look more real. Don't make the paper perfecly smooth, so subtle maps for bump and roughness will work really well, even for high-gloss paper.


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.


Hope this helps!
__________________
VFX Artist
// OSL Shaders //
 
Old 10-19-2008, 03:49 PM   #58
playmesumch00ns
Lord of the posts
 
playmesumch00ns's Avatar
render monkey
pretty picture maker
United Kingdom
 
Join Date: Jul 2002
Posts: 3,420
The name 'reflection' used as a shader parameter is an absolute nightmare, since as Rens said 'diffuse' reflection is still reflection, it's just diffuse as opposed to specular. It's all needlessly confusing.

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

You can have your characters photoreal, fast or cheap. Pick two.
 
Old 10-19-2008, 07:04 PM   #59
shroomer
Veteran
OM
London, United Kingdom
 
Join Date: Jan 2008
Posts: 30
those are great explanations - thanks to all of you.

i am a bit confused so i'll have to read this all again and try some materials out to see how they look.

in layman's terms:

i give the paper material an 80% white diffuse - because no material is 100% reflective

i give the paper 100% glossy fresnel reflection - because the level of reflection is greater when the angle of incidence is lower

when the angle of incidence is lowest (and therefore reflection is highest) the renderer will calculate that since reflection is so high, diffuse is not relevant and therefore the 'sum of light = 1' rule is preserved. similarly, when the angle of incidence is higher and reflection is lower, the renderer then takes into account a higher diffuse value.

when reflection is high, the fact that the reflection is so glossy means that the material will reflect back its own colour???? this is the bit i don't understand (or one of the bits!)

in vray, AFAIK, fresnel is applied either as a setting in the reflection panel - simple on/off and adjustable IOR, or it can be applied as a map with user adjustable reflection levels and 'roughness' curve
 
Old 10-20-2008, 12:46 AM   #60
Rens
rope folly
 
Rens's Avatar
portfolio
Rens Heeren
Senior Generalist
Singapore, Singapore
 
Join Date: Nov 2003
Posts: 1,938
Quote:
Originally Posted by playmesumch00ns
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.

Good point there. So of course one way a lot of renderers are simulating rough surface reflections is by shooting tons of rays at the objects and offsetting each angle. Would having specular 'micro-facets' and also a fresnel calculation for each ray be a correct but slow way of simulating rough surfaces? Or are there some other factors that need to be considered in this case?


Quote:
Originally Posted by shroomer
when reflection is high, the fact that the reflection is so glossy means that the material will reflect back its own colour???? this is the bit i don't understand (or one of the bits!)

Not sure I quite follow what you mean here. But if you're asking what happens when a material has a rough surface then the fresnel effect will not be as visible, it'll seem to spread out as the material gets rougher. In the case of rough paper the surface part of the reflected light, or 'reflection', will still leave the spectrum as it is, it still won't tint it like the subsurface part would. It'll just be added more uniformly on top, with not much of the fresnel edge effect being visible.
__________________
VFX Artist
// OSL Shaders //
 
reply share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 09:55 AM.


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