### Keep up-to-date with Free tutorials!!

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

1 | 2 | 3 | 4 | 5
DGS Exploited

| 64752 Views
| 0
Software used:
Keywords:

And here's a render:

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:

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:

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

Physical Light Exploited

by Florian Wild
published on 2009-12-09

Keywords: maya, lighting, physical,

(0)
0 52294

Mental Ray Texturing

by Florian Wild
published on 2009-12-09

Keywords: texture, texturing, maya, mental, ray,

(0)
0 25696

by Gavin Goulden
published on 2014-08-28

Keywords: ZBrush, ZAppLink, Texture, Seams, Photoshop

(1)
0 21006

Understand key concepts behind texture maps

by Digital-Tutors
published on 2015-03-02

Keywords: Texture, maps, workflow

(2)
0 22453