Again with the Surface Luminance


Didn’t get an answer in the last thread, only found out what wouldn’t work. :slight_smile: So let me rephrase the question:
How can I drive a change by how much light lands on a SMALL AREA ONLY? Not the whole scene, which seems to be what surface luminance does, but a very limited area.
For example, incandescency map on ears (to fake sss look) rises in intensity as the light that hits a small ‘photosensitive’ surface behind the ear increases. As shadow falls across the smaller surface, the sss fake effect disappears from the ears. It seems it would be simple for Maya or MR… Possible with Surface Luminance? Possible at all?

edit: or maybe LightInfo can be used somehow to get the direction of the light at least, not as good but better than nothing… can’t leave it to the poor animator to guess when light is shining on the back of the ears and not… (and real sss, well I’m not so happy with it for skin yet…)


Both SurfaceLuminance and LightInfo give information about the currently rendererd pixel at rendertime and can control shading attributes (just like the simple surfaceluminance.Out value->vramp.Vcoord / vramp.outcolor -> Lambert.color setup). Since they work on per pixel basis, they are actually independant of any objects or the scene, they cover only the small area (the pixel) currently beeing sampled. SurfaceLuminance just returns how much light the rendered pixel gets, therefore it is good for simple sss fakes, however, only as long as the point is visible, which means that the the backlighting setup you want to create will not work with SurfaceLuminance, since the “photosensitive” surface behind the ear doesn’t get sampled. It “could” be possible with LightInfo (although i never used it for that purpose). You could query the world position of the light and/or the vector between the light and the sampled point, driving the self illumination of the material when the light is in the area behind the ear, or maybe, for a simple fake, just in the field of view. If i find the time I’ll take a look at it later, or maybe any of the others already have a working setup like that.

I’d just use a fake setup, illuminating the dark areas of the ear using the incandescence of the material(fresnel falloff etc etc.), and let the animator turn off this fake whenever the ear really has to be completely in shadow. Or i would use the very simple setup, turning off the sss when the cam is out of the field of view, however, this would lead to abrupt changes of the shading whenever the light enter of leaves The FOV, and is not suited for heavy camera movements.


Quick, dirty…something like that.


Is it my computer or are all the attachments…messed a bit?


CIM, I’ll try that when I get back in the office. But what LennO writes seems to make sense, that it will only work if the surface is visible to the camera, in which case SurfLum won’t work, since the trigger-surface has to be positioned behind the main object from the POV of the camera to be of any use.

Maybe a second camera grouped and locked to only see that small trigger-surface, rendered before the main animation. It renders a very lowres image ranging from white to black, named say EarglowControl.jpg.0001 etc that is then used as a file-texture in the main animation to control the ColorGain of the earglow? Just have to make sure it renders first.


Did you never try to use any of the “funky” sss-shaders for mr that are floating around. I had some nice results with the one from, but maybe it doesn’t really suite your needs. Maybe you should give it a try. I’m not sure, but I think trying to use SurfLuminance node to fake some sss would probaly not work. I think maybe there is a chance using the lightinfo node as it gives you information from where the light hits the surface. So when it comes from behind, you could increase incandescency or the gain of a map. But its the question how correct it will look, if you are using shadows, and for example light comes from behind to light an ear, but another object is casting shadow… hmmm, that certainly needs some research…



Hey Steven, after a while, the man hours going into research offset the rendertime of true SSS…

Anyway, you can’t use the sampling nodes because as was mention, they sample rendered pixels.

surf lum is worth a try… but I bet it’s the same deal, it visible luminance.


Tried all the sss shaders, just not as impressed with them as others seem to be. First, they all seem to suffer from being great for highly translucent objects like chunks of ice or jade, but really difficult to tune for skin. Secondly, they seem to be very fast at first, when the translucency is set deep and blurry, but when you want a thinner more high-res effect they become very slow. This makes them great for backlit ears, but not so great for the rest of the face. Thirdly, Mark Davies plugin keeps aborting on all my machines. :slight_smile:

I haven’t spent that much time on researching this, maybe a few hours all told, not counting the actual painting of the maps. I have a feeling that camera-rendering trick would work fine too.


as for mark davies plugin, it essential (as for every other mr shader in maya 6) that you have a node id value assigned in the mi file. this node id must be the same on all of your workstations.



Just bake the illumination into textures, then lookup the texture to see how much illumnation has fallen at a particular point.

Doing this in Maya could be tricky… but I’m sure there’s a plugin that will let you sample a texture as if it were an array. Then you can base your sss fake light on the illumination received in a few pixels of your baked texture.

See what I mean?


The nodeid isn’t it, sometimes his plugin works, sometimes not. And all my other third party shaders work fine. Just to be sure I tried adding the nodeid just now; nothing.

edit: Playmesumchoons, that’s a good idea, similar to the extra camera trick. No lookup needed either, if it’s done right I could just use the baked texture straight in the ColorGain of the other texture.

edit2: downloaded it again, works now. :slight_smile:


Maybe you should try the Diffusion sss shader. It’s much nicer. Also, misss_* shaders look interesting, however, they don’t seem to be available right now?


Hm, testing is going better this time around, so I think I like the subscatter better than Diffusion, for skin anyway.


I’m actually working on my first head right now, and using the sss seems to be doing a great job. Only problem I’m having is when I put a file texture into the extinction scale it messes the render up and doesn’t respect the file (if I put a ramp or something it respects it though).


Here’s a test I did a while ago using surface luminance to fake translucence. The top layer is skin, the bottom layer flesh. The value of light that hits the surface determines the opacity of the skin over the flesh.

The limitation of the surface luminance node is it’ll only give you the value of light on the surface. In the shader above the red will not continue into the shadows like a true SSS shader.


thats not too bad i have to admit!



hmm, well there is one simple solution to this. use the mr Diffusion shader and turn on SSS map, and link a black and white map to the material and whatever your paint white shows SSS, and whatever is black isnt… In the documents though this is not the main purpose but this does work… link it to ambient, or illum and paint sensitive spots the whiter the more light will shine though.

not a true SSS implementation, I also am not satisfied with SSS results yet, but u can use it in that way.

personally i like subscatter better than diffusion in subscatter ii find a samp1 of 64, and samp2 of 32 is great, Dont forget about HSV, my old subscatter default setup is.

Scatter HSV: 34.09 , 0.910, 0.897
Absorb HSV: 17.14, 0.391, 1.790
Ext: 1
Ref: 1.33
Ani 0.0
Fresnel : 0.5
Samp 64
Samp2 32
Samp Radius 0
Hsv 0 0 0

link into mutiply utility as a SSS gamma control, into ambience of shader.

Working on an experimental skin setup with purely Mentalray nodes.



Give it to us mental images! :slight_smile:


it pisses me off having the 3.3.2 beta with all the lovely sss shaders, but no way of using them from Maya!!!


Kryoboy, question about your shader here:

Vushvush, I’m pissed off about it even though I don’t have the 3.3.2. :slight_smile: