Home Technical Talk

SSS fast skin shader question

polycounter lvl 17
Offline / Send Message
Xaltar polycounter lvl 17
Hey guys. I've been messing around with the sss skin shader and have a problem, I can get my skin looking how I want it but when I try to render to texture I get black unwrapped to my uvs. I have 3 spotlights on the model. Any idea why it would come out black and how I can get it to render the skin properly? I am trying to bake the shadows and lighting for an old game engine with no normal or spec support..

Oh and I have the render to texture dialogue set to mental ray like it should be (or should it?)

Replies

  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    You can't render the skin shader to texture, because it depends on camera and light position to work out how the subsurface scattering will affect the material, so it can't work in UV space. It will only ever work in a 3D render.
  • Xaltar
    Offline / Send Message
    Xaltar polycounter lvl 17
    Oh, that sux...

    Thanks for the info, guess I'll just have to bake my lighting into a regular material then.

    It looked so nice frown.gif
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    you could just render it from deveral angels and stitch it together in Photoshop wink.gif
  • Rob Galanakis
    [ QUOTE ]
    you could just render it from deveral angels and stitch it together in Photoshop wink.gif

    [/ QUOTE ]

    Since the shader is based on camera angles, though, it still wouldn't work...
  • Xaltar
    Offline / Send Message
    Xaltar polycounter lvl 17
    Yeah, it won't blend well. I don't get why it doesn't just render according to the lighting setup and position you set like it does any other material... Oh well, I guess I'm stuck with the crappier regular spec/normal/diffuse/etc settings...
  • Rob Galanakis
    Many calculations depend on calculations involving the eye vector, whether it be specular lighting, rim lighting, fresenl/glance highlights, etc. Without the eye vector, there couldn't be an equation for it (ie, specular lighting is dot(N, (L+E) (L being the light vector, and E being the eye/camera vector), and fresnel lighting begins with dot(N, E). Diffuse lighting only takes into account the normal (N) and light (L) (dot(N, L)), so it independent of camera vector.

    I haven't used fastSSS in particular (nor any software SSS renderer), but in the hlsl skin shader I wrote (and those I've looked at), many variables are tied to the eye vector... in mine SSS isn't tied to the eye, but on the other hand, its just a relatively crude SSS fake... real SSS involves light entering the skin and bouncing back out, so I'd assume the angle of the camera would influence how much you see somewhat... my guess is, it is the other parameters, not SSS, that are tied to the camera position more or less, and why your render wouldn't turn out correct.
  • rooster
    Offline / Send Message
    rooster mod
    I'm curious, why you can't do this in the same way youd bake specular? find a camera angle and light position that produces some nice results, bake it, go to another camera angle, bake it, maybe another- then patch together the results in photoshop. Baking specular will only work for the areas the camera can see, and it puts on the texture the exact pattern as shown on the model from that angle- which is why the multiple angles are needed.

    well if it renders black obviously its not going to work but I don't see why the principle is different?
  • Daz
    Offline / Send Message
    Daz polycounter lvl 18
    All that being said about the correct mathematics, I've actually gotten pretty decent results from painting incandescent, emmissive or ambient maps for rendering without SSS. A pretty dark map with red/orangey bits for ears, end of nose and other more fleshy parts can, although not technically correct of course, work suprisingly well under certain circumstances.
  • MoP
    Offline / Send Message
    MoP polycounter lvl 18
    Yep Daz, that's what I was thinking... just a subtle glow map, as it were. Although then the character would look weird if they were standing in a pitch-black room smile.gif
    But yeah, it'd work fine for situations where you can control the position of the character and lighting, it'd probably even work pretty much fine for most in-game situations except Doom3 corridors laugh.gif
  • SUNCHIRP
  • Neox
    Offline / Send Message
    Neox godlike master sticky
    [ QUOTE ]
    Since the shader is based on camera angles, though, it still wouldn't work...

    [/ QUOTE ]

    maybe it would not be mathmetical accurate, but that was not the thing I was aiming for, i did this several times and it worked out pretty well, of course you have to put some work into it, but having pre baked SSS in the diffuse texture workes quite good, at least for me
Sign In or Register to comment.