how to output SSS layers into framebuffers


#1

is there a way to output the layers of the fast skin shader to framebuffers? I want to break my sss up into each of its layers so I have control over diffuse, epidermal, subdermal and backscatter. the problem is that I can’t seem to figure out where to access these layers.

ive tried ctrl_buffers, however, it looks like the SSS shader doesn’t actually have the result layers to output to the framebuffers. I could potentially do render layers and use the layer overrides to isolate each SSS layer, but that is a bit tedious and waste of render time. any ideas on how i can split those layers out?


#2

Hi
If you are using Maya2009 you can do that by hocking each layer (diffuse, epidermal, subdermal and backscatter…etc) to the Node Utility WriteToColorBuffer

/rachid


#3

that works for the fast SSS, but not the fast skin shader. the fast SSS can be hooked up with colorToBuffer , by connecting front _result to the colorToBuffer node, back_result to another colorToBuffer node and doing the same for all the other attributes, however, the fast skin shader doesn’t have those “_result” attributes to hook up to the colorToBuffer node…


#4

Hi
you do that in the connection Editor
load your fast Skin shader in the left and WriteToColorBuffer to the right
/rachid


#5

i’ve tried that, but i don’t see what to connect. there doesn’t seem to be logical outputs from the misss_fast_skin to put into the WriteToColorBuffer.

for example, if you look at the misss_fast_shader it has attributes in the connection editor called Diffuse_result, front_result, back_result, spec_result. so basically, those are the individual passes that you’d plug to the WriteToColorBuffer. The misss_fast_skin doesn’t have those “result” attributes. maybe i’m looking at the wrong thing or we are on different pages, but what would get connected to the WriteToColorBuffer to get this to work for the misss_fast_skin


#6

Hi
you can output to WriteToColorBuffer Node Utility all theses listed below

#Diffuse Layer
Ambient
Overall Color
Difuse Color

#Subsurface Scattering Layer
Epidermal Scatter Color
Subdermal Scatter Color
Back Scatter COlor

#Specularity
Primary Specular Color
Secondary Specular Color
and the bump Shader

/rachid


#7

i’ll give that a go


#8

as i had thought, it doesn’t work . by plugging the epidermal color into a writeToColorBuffer you get just that color, not a render. for example, i rendered a sphere with SSS, made 3 writeToColorBuffer nodes, and connected front, mid and back sss to those nodes. it just spits out a red circle for back, orange for mid and a lighter orange for front.

what i need is what the misss_fast_shader has…it has those nodes for front_result, back_result, mid_result.

check out this image. On the right is the MISSS_FAST_SHADER_X it has attributes that can be plugged into the color of the writeToColorBuffer. those attributes are diffuse_result, specular_result, front_result, back_result etc…

the MISSS_FAST_SKIN has no such attributes. internally it is creating those layers because at the end of the render it does a screen composite…is there no way to gain access to those so I can output them??


#9

hi
yes you are right but you can do it this way:
by creating one master shader misss_fast_skin_maya, and for each pass you need, create another misss_fast_skin_maya and plug it to the master layer
take a look at the attached scene

/rachid


#10

ah, yeah, that could probably work…i’ll give that a go…thanks


#11

tried that scene out and it got me on the proper track…thanks. i did however change one thing. instead of pushing each SSS layer through a final SSS shader, I replaced that final one with a Mix8Layer instead. it gives me the ability to set my blend mode for each layer, works like a charm. It appeared that the render result was different by putting all the other SSS layers into another SSS shader at the end of the chain, the Mix8Layer worked perfect and created an exact replica of a render using just one SSS shader. I then just pumped the output of each layer through a writeToColorBuffer and i got all my layers out.

it requires a bit more setup obviously to do it this way, but until it is properly built into maya this will have to do …thanks so much for your help


#12

Man that’s something I was trying to achieve for days!

I tried to achieve that with sss-fast-passes plus a sss_specular shader,
but your examples make perfect sense.

Thx Achoury.
And ZipZopp, would you mind to upload your example file for us too?


#13

Hi
mustique
the scene is already there in this thread

ZippZopp
Interesting approach but you are outputting the pass from the SSS shader, and the Utility node WriteToLabelBuffer can’t read data from Mix8Layer since it’s not connected to it, so the blend mode in Mix8Layer do not affect the outputting pass
So what if you output each layer with the blending mode from Mix8Layer to the node Utility WriteToLabelBuffer? that will be great if it work!

/rachid


#14

hi
finally we can use mix8layer with WirteToLaberBuffer I’ve attached a scene file for someone want to know how to us it.
ps: just remove the .Zip extension in the file attached.

/rachid


#15

I guess the way I was thinking about it was to use the Mix8Layer on a mesh in maya so I could see how the overall skin shader was working. Once I tweaked it and got it looing good i would then just be outputting the passes from each different layer into the writeToColorBuffer. really only using the mix8layer to preview the overall composition in maya. i did run into a few problems though in terms of what it was looking like which I wasn’t able to track down. i’ll give your method a try to see how it works.

my train of thought was that each layer of the SSS would be composited together in shake or photoshop using screen blend modes. so your layers would look like this…(bottom layer being backscatter)

spec2
spec1
diffuse
epidermal
subdermal
backscatter

so i essentially tried to mimick that right in maya by using the mix8layer to layer them together. again, i ran into some problems with the way it was lookig so i was obviously doing it wrong, but i’ll give your scene a try. we should keep this thread alive. I’ll be doing a bunch of tests and will report back in here with what works and what doesn’t


#16

Thx for the update achoury and yes, this thread should be kept alive :buttrock:


#17

Just a suggestion, for those that dont have mix8layer (like me im using Linux 64), another way is using the Mib_color_mix

hypershade–Create Render Node–mental ray–Miscellaneous

:thumbsup:


#18

i’m going to work on getting a script to automate this setup and hopefully create a custom node that will give access to each shaders attributes in one place so you won’t have to go into each individual shader to tweak values


#19

Hi
According to slipknot66 post, here is another way to get all the pass using mibColorMix

setup

passes

as always I’ve attached a scene file

/rachid


#20

cool stuff achoury. I’ve been playing around a bit more and I’ll upload a file soon where I’ve streamlined it a bit. what I decided to do, for ease of control, is create one more SSS shader to put at the beginning of the chain. I used connection editor to connect up all attributes into their corresponding “layers” so now you tweak all your values in one main SSS shader and it all gets propagated down through all the individual layers. Just a little easier than going into each shader to tweak each value. I’ll upload something soon