Keep up-to-date with Free tutorials!!

 

Sign up to our twice-monthly newsletter today for the latest tutorials, interviews and product information.

Sign me up to receive third-party emails from 3dtotal's partners, too!

- Latest news
- Exclusive Shop Offers
- Preview early content
- Plus much more

 

Not Ready to take that step? OK, Why not just Subscribe to the RSS Feed

 
submit tutorial
1 | 2 | 3 | 4 | 5
DGS Exploited

By Florian Wild
| Your Rating:
rating star nonerating star nonerating star nonerating star nonerating star none
(0 Votes)
| 41721 Views
| 0 Comments
| Comments 0
Date Added: 9th December 2009
Software used:
Maya, mental ray

And here's a render:

500_tid_image_12.jpg
Note that we set the diffuse colors back to 0.5, and the specular colors to 0.5 as well. This is because the dgs photon shader enforces energy preserving 'scattering coefficients'. The source comments:
[code]/*
* The dgs photon shader enforces energy-preserving scattering coefficients,
* that is, the following three requirements:
* diffuse.r + glossy.r + specular.r has to be <= 1,
* diffuse.g + glossy.g + specular.g has to be <= 1,
* diffuse.b + glossy.b + specular.b has to be <= 1.
*/[/code]

This means, we would get physically incorrect results if we used photon tracing and a combination of diffuse, glossy and specular values that exceed a total value of 1.0. In other words, the V components of our HSV colors should be smaller than 1.0 in the sum.

Speaking of photons, what can we do to mimic the dgs' photonic behavior? All though the solution is easy, it's a bit tricky if dont have any starting point. Well, here it is: We switch off the Derive From Maya checkbox and press the Take Settings From Maya button, to inherit anything we did from the regular shader. It will look like this first:

500_tid_image_13.jpg

To recover from the irradiance trick we applied due to internal 'correction-calculations' the shader does, we would need to multiply the photonic intensity by pi again. To do this, we again use the diffuse attribute, but this time the miDiffuse or photonic diffuse attribute. It's currently at 0.318 (1/pi) - so if we multiply it by pi, it yields exactly 1:

500_tid_image_14.jpg
And glossiness? Well, the glossy color is again the same as 'Specular Color' (with reflctivity 1.0), the shininess is controlled by 'Reflection Blur' attribute - where a 'Shiny' value of 5 equals (experimentally obtained) approx. a 'Reflection Blur' of 13. However, in my experience it is usually better to rely on custom blurry reflection shaders, like Francesca Luce's ctrl_shading - simply because they are faster than the built-in reflection blur. You can plug the ctrl_shading's reflection output into the Reflected Color slot of your Maya shader, turn the Reflection Limit attribute under Raytrace Options of your material to 0 (to completely hand over raytracing to the custom shader) and set the ctrl_shading's reflectivity to 1.0 (it's actually called 'Scale' in the shader) - it will be properly scaled by our Specular Color attribute of our Maya shader, so no worries. If we use photon tracing, we simply set the 'Shinyness' value of the photon part of our Maya shader to the same value as in the ctrl_shading. The ctrl_shading can be found here: http://forums.cgsociety.org/showthread.php?t=252304

Alternatively in Maya version 7 the mib_glossy_reflection can be used, which now ships with the MentalRay base shaders.

If you ask yourself why the dgs are still faster, specially when using finalgathering, there is an answer too. The dgs internally rejects light sample calls on the 'wrong' side of your surface (the side with normals pointing away from the light). In my tests this reduced the amount of light sample calls by about 30%, resulting in faster rendering. Unfortunately, this cannot be simulated by our Maya shaders, so we have to bear with it.

That's it! I hope you enjoyed the little brain workout! Much of theoretical stuff and no beautiful pics, but "The noblest pleasure is the joy of understanding." (Leonardo da Vinci)




< previous page
 
1 | 2 | 3 | 4 | 5
Related Tutorials

Tutorial

Gallery Image.



Keywords: scene, street, building, alley, texture,

Go to tutorial
rating star fullrating star fullrating star fullrating star fullrating star full (7)
Comments 2 Views 72129

Tutorial

Gallery Image.



Keywords: texturing, tileable, textures, video,

Go to galleries 1
rating star nonerating star nonerating star nonerating star nonerating star none
Comments 0 Views 4939

Tutorial

Gallery Image.



Keywords: render, passes, diffuse, specular,

Go to galleries 1
rating star fullrating star fullrating star fullrating star fullrating star full
Comments 2 Views 132415

Tutorial

Gallery Image.



Keywords: bump, specular, photoshop, texturing, video,

Go to galleries 1
rating star nonerating star nonerating star nonerating star nonerating star none
Comments 0 Views 4937
Readers Comments (Newest on Top)
no comments!
No comments yet. Be the first to comment!
Add Your Comment