PDA

View Full Version : MIB_glossy simple question


royterr
06-08-2006, 01:59 AM
How can i use the MIB_glossy_reflection with dgs without having an over diffuse material, just like in reflection blur of a blinn (where diffuse and reflection are 2 separate things)


becose when i assign a diffuse map to the diffuse slot of the DGS ( wich is connected to the MIB_glossy_reflection), the material is always overbloan even if i assign a dark map.

bgawboy
06-08-2006, 03:21 PM
How are you combining (ie, connecting) dgs and mib_glossy_reflection?

I assume you are zeroing out the G part of the DGS.

Also for physical correctness the coefficient for diffuse (its color) plus the coefficient for glossy (its color) should not exceed all ones (white).

What aspect of the DGS are you using besides the diffuse? If none, why not try lambert instead?

royterr
06-09-2006, 04:24 PM
How are you combining (ie, connecting) dgs and mib_glossy_reflection?

I assume you are zeroing out the G part of the DGS.

Also for physical correctness the coefficient for diffuse (its color) plus the coefficient for glossy (its color) should not exceed all ones (white).

What aspect of the DGS are you using besides the diffuse? If none, why not try lambert instead?

well...the G (of the dgs) as mapped to the mib_glossy_reflection node (default)
the base_material slot of the mib_glossy_reflection is maped to the DGS material.
and the mib_glossy_reflection is applied to my object.

So, the the diffuse of that material is controlled by the environement color of the mib_glossy_reflection node.wich is is bizzare because i red in the MR documentation that in mib_glossy_reflection: environment color and reflection color should be the same for physical correctness.


I am doing all this in order to get the reflection blure effect like in maya native materials but with the mib_glossy_reflection material.

thanks

bgawboy
06-11-2006, 06:11 PM
Sounds like you have some sort of circular connection.

Try this first:

Plug an mib_illum_lambert into the base_material input of the mib_glossy_reflection.
Then, apply the mib_glossy_reflection to your object.
Do you use the right click on the object to assign it?
That method guarantees a pretty clean SG will be created with only those shaders in it.

Now the diffuse color comes in through the lambert, and your blurry reflections are controlled by the size you use in the glossy reflection. The quality for larger blurs can be increased with more samples. Likewise, for smaller blurs, reduce the samples for faster rendering.

bgawboy
06-11-2006, 06:14 PM
Once you get a feel for that, then replace the lambert with the DGS.
But now, you don't need the glossy part of that shader, so zero it out.

royterr
06-14-2006, 12:26 AM
bgawboy thanks alot.

well i was using the same method that you desribed but with a dgs.

After some tests, this is what i found :

- the "environement color " of the mib_glossy_reflection shader shoud always be black (yes...i know that this contradicts it's documentation where it is said that it should have the same value as the reflected color slot).

this is what you can get if you apply a reflection map to the "reflection_color" slot
http://www.aedii.qc.ca/v2/fichiers/uploads/section_4/11.jpg
(sorry for the ugliness)


http://www.aedii.qc.ca/v2/fichiers/uploads/section_4/13.jpg
and that's what you can get if you apply the same reflection map to the "reflection_color" slot and to the "environment_color" slot.

now i really don't now wich is more "physicaly acuurate"....



-Yet another question.

In Maya shaders, you apply color maps and diffuse maps. Now in a shader as dgs, you can't do that since you have only the diffuse slot.

How can one use a mental ray shader by aplying collor and diffuse maps seperatly?

pgland
06-14-2006, 02:29 AM
royterr - hey there

the diffuse and colour can be contained in one texture. They are really the same thing to the DGS.
If you think in terms of HSV(Hue,Saturation,Value) instead of RGB, then you would use the Hue and Saturation to control the colur, and the Value to control the diffuse.

That texture plugged into the Diffuse slot of the DGS would control both colour and diffuse.

royterr
06-14-2006, 02:56 AM
ok
but what if you had2 maps.
one for color and the other for diffuse (for more control and realisme).

How would you apply both maps in a MR shader?

pgland
06-14-2006, 01:37 PM
You would never need to. You could get no more control if you used two textures, in fact it`s confusing matters.
Colour is seperate form Value, so a red colour in HSV is everthing from 0,1,0 to 0,1,1. The V component would represent the diffuse.

In the case of the DGS, this is how you should think of the diffuse texture slot, as both colour and diffuse.
From what I understand, this is a more physically accurate way to make your shaders.

If you have one diffuse map and one colour map, you can easily combine them in photoshop to create the single map the DGS requires, without any loss of information.

bgawboy
06-14-2006, 02:39 PM
Environment color and reflected color are multiplying factors. So typically you set them to the same because when the ray reflects, you want the same multiplying factor whether the ray hits another object or hits nothing (so that it calls the environment shader).

I'm not sure why you are using reflection maps in combination with reflection rays.

cpan
06-14-2006, 03:06 PM
hi barton,
i'm a bit confused... if i plug the dgs intro the mib_glossy_reflelection shouldn't i set both the glossy and specular to 0 V? cause the mib_glossy allready has controls for blurriness and reflection strength...

bgawboy
06-14-2006, 03:35 PM
yashu,

Yes. At first. But one contribution will be missing.

The mib_glossy_reflection shoots reflection rays and does not account for direct illumination reflection. So specular highlights still need to be controlled by some direct illumination algorithm, phong, blinn, ward, etc. There is one related to I think cook-torrance or ward inside the DGS shader. I should double check to see if it is covered through the specular color.

The makeup of a reflecting material:

Direct diffuse illumination - lambert using light loop
Indirect diffuse illumination - GI/FG (also happens to be added into mib_illum_lambert)
Direct specular/glossy illumination - added into phong, blinn, ward, etc. in addition to a basic lambert calculation
Indirect specular/glossy illumination - added in through reflection rays

royterr
06-14-2006, 04:20 PM
yashu,

Yes. At first. But one contribution will be missing.

The mib_glossy_reflection shoots reflection rays and does not account for direct illumination reflection. So specular highlights still need to be controlled by some direct illumination algorithm, phong, blinn, ward, etc. There is one related to I think cook-torrance or ward inside the DGS shader. I should double check to see if it is covered through the specular color.



so with dgs, you wont get the direct illumination reflection, (only secondary rays).

so reflective materials just like in real life:
http://www.aedii.qc.ca/v2/fichiers/uploads/section_4/zzzz.jpg

must have a specular highlights attribute, right?
such as blin or phong for example, a refective floor like that must have that kind of attribute (+the glossy reflections). PLZ correct me if i am wrong.

cpan
06-14-2006, 06:08 PM
yashu,

Yes. At first. But one contribution will be missing.

The mib_glossy_reflection shoots reflection rays and does not account for direct illumination reflection. So specular highlights still need to be controlled by some direct illumination algorithm, phong, blinn, ward, etc. There is one related to I think cook-torrance or ward inside the DGS shader. I should double check to see if it is covered through the specular color.

The makeup of a reflecting material:

Direct diffuse illumination - lambert using light loop
Indirect diffuse illumination - GI/FG (also happens to be added into mib_illum_lambert)
Direct specular/glossy illumination - added into phong, blinn, ward, etc. in addition to a basic lambert calculation
Indirect specular/glossy illumination - added in through reflection rays


ah thanks a lot, much clearer now :thumbsup:

:)

YourDaftPunk
06-14-2006, 07:02 PM
You'd think area lights would be directly reflected since they are like geometry. Hmmm.

Instead of faking specular with a phong or blinn, couldn't you put geometry (a plane for rectangular area of course, etc) near the light with a highly ambient lambert and have that reflect in your DGS as the direct light reflection? Wouldn't be as fast but, wouldn't that be more accurate?

Gal
06-14-2006, 11:25 PM
2 techniques i use to mimic real world reflections.

one of them adds some render time because you use 2 shaders your final shader and an illumination sampling shader but it's not much and helps soo much..

1.
what i do is attach a black blinn with 100% reflection .out to a ramp which goes into a reflection slot of your final shader (or pass/mix20layer network). and adjust the ramp for clipping.
this allows you to clip off low .V values of pixels and keep the high ones you are reflecting and basically apply a levels/contrast node to your reflections. this creates the same effect of using hdri probes since you are visually rendering to 255,255,255 anyway no matter what technique you use you only have this limited range of values to render on screen at 8 bit, hdri just pumps light values really high so darks get muted. this technique does the same but! with control, can use with hdri probes with this too.

the idea of clipping dark values or strong reflection of light values only is critical and obviously HAPPENS in EVERY real life surface with reflection(almost everything) except mirrors. this ofcourse blends with freshnel and other aspects of control.

you can use this to control hue/saturation/blur/decay of reflections as well not to mention other aspects of your material besides reflection, like glow in the shader or as a pass (basically this is the same as leveling out darks and only keeping strong whites,blur and use it as screen/add in post but this wont "pixelate" and lose details when u do it)

2. an illumination pass to control reflection. same concept just render a pass of direct illumination only (and indirect if u wish for another level of control) and use that as a controller for the reflection pass in post. you could do this in 3d the same way i did 1. but that would be slow and..pointless unless you dont composite anything then you can use this technique.


hope this helps for some people.

royterr
06-15-2006, 06:14 PM
i am doing some test with both methods.


Now i heard that ctrl_rays could be used to speed up rendering times when it comes to reflections.

So how can i use it with the mib_glossy_reflection node?

cpan
06-15-2006, 06:40 PM
i am doing some test with both methods.


Now i heard that ctrl_rays could be used to speed up rendering times when it comes to reflections.

So how can i use it with the mib_glossy_reflection node?


you're reffering to speeding up the glossy when using final gather?
then duplicate the mib_glossy1 and then plug the mi_glossy1 into the ctrl_rays.eye and mib_glossy2 into ctrl_rays.fgprecomp. Now set the glossyness on the mib_glossy2 to 0 to make the fgprecomp phase see the shading as non-glossy, thus speeding up the rendering a bit. Finaly asign the ctrl_rays to your objects

royterr
06-17-2006, 03:17 AM
you're reffering to speeding up the glossy when using final gather?
then duplicate the mib_glossy1 and then plug the mi_glossy1 into the ctrl_rays.eye and mib_glossy2 into ctrl_rays.fgprecomp. Now set the glossyness on the mib_glossy2 to 0 to make the fgprecomp phase see the shading as non-glossy, thus speeding up the rendering a bit. Finaly asign the ctrl_rays to your objects

thanks alot yashu (member.php?u=87726) , you have been a great help for me!

Now is it normal to have a little difference in the render when you use ctrl_rays with MIB_glossy_relfections (mabe a little less qiality)?

royterr
06-17-2006, 03:20 AM
yashu,

Yes. At first. But one contribution will be missing.

The mib_glossy_reflection shoots reflection rays and does not account for direct illumination reflection. So specular highlights still need to be controlled by some direct illumination algorithm, phong, blinn, ward, etc. There is one related to I think cook-torrance or ward inside the DGS shader. I should double check to see if it is covered through the specular color.

The makeup of a reflecting material:

Direct diffuse illumination - lambert using light loop
Indirect diffuse illumination - GI/FG (also happens to be added into mib_illum_lambert)
Direct specular/glossy illumination - added into phong, blinn, ward, etc. in addition to a basic lambert calculation
Indirect specular/glossy illumination - added in through reflection rays

What if you pluged the mib_glossy_reflection to the glossy node of your dgs (base material or mib_glossy_reflection) would that be accurate ?

bgawboy
06-17-2006, 05:28 AM
royter,

In your couch image, to determine whether you need direct specular/glossy contribution, it depends on how the light gets to the reflecting surface. How would you model the light for that scene. I would probably not use a light but some kind of outside HDRI for that scene. In that case, with no direct lights no direct illumination reflection needed.

bgawboy
06-17-2006, 05:47 AM
An area light is visible by reflection rays only if it is made to be visible.

But you have to be careful not to double the light contribution from both the direct illumination loop (in a phong, blinn, or even dgs) and the reflection ray sent out by the indirect reflection calculation (in mib_glossy_reflection).

I suggest doing a test, because I am not sure how the applications translate visibiilty.
Use just your area light, and turn on visibility.
With just the glossy reflection, can you see your area light?
With just the phong, blinn, dgs, can you see the direct specular/glossy reflection contribution of the area light.

bgawboy
06-17-2006, 05:52 AM
Finally, it does not make sense to plug the output of a reflection node into the input of glossy in a dgs shader. This would reduce the quality of your glossy effect.

The dgs shader only takes one sample in a glossy cone of specularity, whereas you can set the number of samples in an mib_glossy_reflection. The glossy input of the dgs is the color that is multiplied by the illumination, a single sample glossy calculation.

bgawboy
06-17-2006, 06:06 AM
I just double checked the DGS shader, and it uses the Ward specular/glossy calculation.

So you could accomplish similar direct illumination much easier with a Ward shader rather than a DGS shader.

CGTalk Moderation
06-17-2006, 06:06 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.