# Problems with light and shadows from DGS materials

**URL:** https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946
**Category:** Maya
**Tags:** mental-ray
**Created:** [March 17, 2003, 8:59pm UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946 "2003-03-17T20:59:21Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 17, 2003, 8:59pm UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/1 "2003-03-17T20:59:21Z")

</div>

I have done some experimenting with the DGS material shader, which is meant to give blurred reflections, as well as meant to act as a physically accurate shader for use with global illumination. I will spare the details, but basically any standard shader, be it lambert or phong or blinn, or what-have-you, is not physically accurate… light energy actually increases once bounced off of these surfaces, which is the opposite of what happens in the real world… mental ray’s solution for this is either the dgs material or the dialectric material, to be used in conjunction with the physical light shader, which obey’s real world fall-off rules… anyway, it would appear that for some reason direct illumination ceases to function once I apply a DGS shader… in my remarkably simple test scene I start with a blue lambert ball and a white lambert floor, with a point light converted to a mental ray rectangular area light pointed at the ball… with raytrace on and nothing else, the light casts a soft shadow from the ball onto the floor… so far, all is well. next test, I change the ball’s lambert into a diffuse blue dgs material… everything else remains the same. What happens now is that the shadow remains, exactly as it was, but the ball COMPLETELY dissapears… well, let me be more specific. the ball is there, it just doesn’t appear in the RGB channel (or, if it does, it has some form of wacky yellow or red or green squares all over the area where teh ball should be, and no color/shading that even remotely resembles a ball. these are obviously errors…). the alpha channel shows pieces of the ball there (sometimes correlating to the wacky colored squares, sometimes not)… ok, very odd… but maybe maya’s shaders are messing it up, so now I’ll turn on “suppress all maya shaders…” I get the same result. ok, so let me turn my light into a physical light… physical DGS shader, physical light… makes sense, right? so, I apply a physical light shader to the light, adjust the color values accordingly (since, like the energy attributes, the physical light shader’s color depends on the inverse-square fall-off law, and is thus rarely ever in the range of 0-1… usually it gets to be quite higher), and hit render. the shadow still looks fine, but the ball, again, gets completely screwed up, now with different colored-square-errors than before… so, I figure I should try turning on global illumination, see what happens… after all, these physically based shaders and lighting (dgs and the physical light) are designed to work with global illumination. So, I turn it on (and add a dgs photon material to my ball, to keep physical accuracy in my photons), and it shows a nice blue color bleed into the shadow… from a partially blue, partially screwed-up-wacky-colored-squared-ball… So now let me turn the floor into a dgs material, completely diffuse white, as it was for the lambert… I also give a dgs photon to the floor, for physical accuracy. now I get a nice GI-only render… blue sphere, blue color bleed… but there is no longer a shadow on the floor, and, in fact, the floor itself seems to have vanished… this is where I am at now, and let me tell you I am remarkably close to flipping out and breaking things… I can only imagine I am doing something wrong, but I have studied and studied and STUDIED the book “Rendering With Mental Ray,” and cross-referenced the related material to the mental ray for maya documentation, and everything I am doing should work… What I think the problem may be is that the “lights” parameter under dgs material does not seem to exist… Mental Ray’s DGS material has all of the attributes you see in mental ray for maya (diffuse, glossy, specular, shiny, shiny u, shiny v, trans, ior), yet it also has one that is missing. the lights attribute. in mental ray (and, I’d imagine, in XSI), if there is nothing given for that attribute, it is supposed to take into account all lights, but since the paramater simply doesn’t exist in mental ray for maya, it seems to me that it is ignoring all lights, except for photon purposes… whats even odder is that the documentation for mental ray for maya says that that parameter is supposed to be there… also, adding evern further oddness, I looked in the physical.mi file, where the DGS/dialectric/physical light/etc materials are stored, and there is a parameter under the DGS material which states ’ array light “lights” ’ as it should… maya just doesn’t want to display it for some reason. it displays all of the other paramaters… this, essentially, leads me to believe that it is a bug in mental ray for maya… if anyone has any explination on this, it would be GREATLY appreciated. Thank you.

---

<div class="post-metadata">

### Author: ![hoju](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/h/e68b1a/32.png) [@hoju](https://forum.highend3d.com/u/hoju)
#### Post date: [March 18, 2003, 1:27am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/2 "2003-03-18T01:27:44Z")

</div>

Connecting “miExportMrLight” (Light attribute) to “Lights” (dgs material attribute) in the connection editor seems to be a work around, for this bug. I’m a bit dissapointed with the blurred reflections though. Any advice for getting a nice polished/brushed metal look?

---

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 18, 2003, 3:16am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/3 "2003-03-18T03:16:15Z")

</div>

thanks for the tip, I’ll give it a shot… and I imagine your dissapointment comes from the overall “graininess” of the reflection? if thats the case, increasing the sampling quality will help that out. a value of minimum 1 maximum 4 will smooth out the blurred reflections, but take a lot longer to render… overall, I recommend putting a value of -3 min and then 4 max… this way mental ray can decide where it needs more samples (like in the blurred reflection areas). its still a lot slower than, say, -3 2, or 0 2, but its a tad faster than 1 4… so, anyway, for brushed metal, turn glossy all the way up, then ignore the shiny value and use either shiny u or shiny v for your brushing direction… say a 5 value of shiny u will give you blurred reflections along the u axis of your surface. if you put any value in the shiny attribute, it will ignore whatever is in shiny u or v… as for polished metal, not sure what you mean… if you mean a nice clear mirror ball, then just put specular all the way up and lave glossy at 0, if you mean a blurry chrome ball, then put glossy all the way up and put the shiny value at, say, 10 or 15… the lower the value, the blurrier it gets (like the cosine value of a phong material)… and, since you are specifying just the shiny,a nd not the shiny u or v, it will be evenly blurry in both directions… anyway, if you’re still dissapointed, then I don’t know what to tell you…you can always try writing you own mental ray shader! ; )

---

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 18, 2003, 3:21am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/4 "2003-03-18T03:21:17Z")

</div>

ok, that tip for connecting the light attribute to the dgs attribute worked. thank you… I am still getting the odd “colored-square” error, though… I am sure theres just some random soemtihng in my scene causing that… thank you very much for the tip, though!

---

<div class="post-metadata">

### Author: ![hoju](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/h/e68b1a/32.png) [@hoju](https://forum.highend3d.com/u/hoju)
#### Post date: [March 18, 2003, 4:30am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/5 "2003-03-18T04:30:02Z")

</div>

Your welcome! The results I’ve got from the dgs material look kind of like a blurred reflection overlayed on a regular sharp reflection. Not really what I expected the material to look like. Any Ideas?

---

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 18, 2003, 5:28am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/6 "2003-03-18T05:28:44Z")

</div>

well, there are a couple of possibilities here… first off, are you using a combination of the specular attribute and the glossy attribute? specular controls mirror reflections, glossy controls blurred reflections, and you can do any combination of the two… to get a pure blurred reflection, as would be seen on brushed metal, leave the specular attribute at 0 (black) and turn teh glossy attribute up to whatever level you want it at… then adjust the shiny (or shiny u, or shiny v, if you want anistropic reflection)… the other possibility is that you don’t have “supress all maya shaders” clicked on… if thats the case, it may be simulataneously referring to the DGS and to whatever material the DGS is connected to… now, I don’t THINK that would affect it, necessarily, but I dunno… it might… anyway, usually my blurred reflections look great… if I had a site where I could post a test, I’d show you… if you want me to email you a test, I could do that, though… anyway, the only problems I ever have (well, problems as in look, not as in chaos, as stated in my initial post), is that the dgs material with a glossy reflection looks grainy, but I know how to fix that… jut takes forever to render. and, besides, a little grain looks fine if you ask me… is there any way you could post some results you’ve been getting? or post what attributes for diffuse glossy and specular, as well as shiny, shiny u and shiny v, you’re using?

---

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 18, 2003, 8:26am UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/7 "2003-03-18T08:26:42Z")

</div>

does anyone have a problem with getting alpha channels to work properly with DGS materials? my image (RGB) looks great, but alpha channel is, literally, non-existant… the whole alpha is black… I checked to make sure that I have it rendering with an alpha channel (I do), but even if this was a problem, shouldn’t it be all white, not all black? if anyone else has this problem, let me know… hopefully with a way to fix it. Thanks.

---

<div class="post-metadata">

### Author: ![hoju](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/h/e68b1a/32.png) [@hoju](https://forum.highend3d.com/u/hoju)
#### Post date: [March 18, 2003, 9:21pm UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/8 "2003-03-18T21:21:36Z")

</div>

Yeah, it was just the Specular. Don’t I feel silly. Things look cool with it at black. Mapping textures onto shiny u&v might be interesting, but those render times make experimenting pretty slow. Cheers ickytang.

---

<div class="post-metadata">

### Author: ![user\_deleted](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/u/35a633/32.png) [@user\_deleted](https://forum.highend3d.com/u/user_deleted)
#### Post date: [March 18, 2003, 9:53pm UTC](https://forum.highend3d.com/t/problems-with-light-and-shadows-from-dgs-materials/46946/9 "2003-03-18T21:53:42Z")

</div>

Thats why I do most of my expirimenting while watching TV or reading (generally reading Rendering With Mental Ray)… gives me a distraction during those long render times. Have fun, Hoju.
