View Full Version : Faking SSS for realtime?
07-23-2010, 01:48 PM
Hey, I was sure I saw something about this around here somewhere, but after spending ages searching, I decided to ask away. Anyone have a tutorial regarding faking SSS in unreal? I would need it for my foliage.
Thanks in advance!
07-23-2010, 02:02 PM
I think you're looking for this?
transmissionMask and transmissionColor are things you might want to experiment with since they are just for that.
07-23-2010, 03:30 PM
You may be better of searching for translucent shaders than SSS for foliage. Why dont you look at the GDC 2010 tech demo scene that ships with UDK? thats covered in foliage.
07-23-2010, 03:34 PM
Ahhh so THAT is the term I needed. Gotcha. Thanks!
07-25-2010, 04:45 AM
I hope this is useful, I based it on the way Crysis handles SSS (although they do it on a per vertex basis I believe) for one of my schoolprojects.
They plug into both the Transmission and Transmission Colour slots.
07-25-2010, 10:19 AM
That is sweet Nielsen. Actually just saw the paper they had, while I was looking for stereoscopic in Crysis 2.
thats brilliant stuff nielsen. the kind of shader construction that seperates the boys from the men :D
07-26-2010, 07:35 AM
Considering that Crysis does it per vertex, and you do it per pixel (I assume), wouldn't that make it terribly slow in comparison to the Crysis solution?
07-26-2010, 07:39 AM
I think it depends on how he is calculating the vectors. As I recall Unreal lets you do it per vertex
07-26-2010, 08:00 AM
I can't say for sure whether this is calculated per vertex or pixel, I'm guessing the latter though. I suggest you use this on important assets only or swap out materials on the LOD as soon as possible.
It's a start anyways :)
07-26-2010, 08:02 AM
I just did a quick test, and indeed it looks awesome. 8)
07-26-2010, 08:18 AM
Interesting topic, I've been interested in faking SSS in game art for a while now, but I've been thinking about it in a different way (for characters). Is it possible to bake down an SSS pass like an AO pass and just overlay it on a characters diffuse? I know it wouldn't technically be SSS but it would look nice around the ears/nose to have some soft red showing up... saves painting it in :P
well the most simple way would be using the inverse of your lighting multiplied by a colour, multiplied by a mask (i.e. your SSS pass, but as this is highly view and light dependend a thickness map would be what you need), basicly what it does is brighten up the areas that don't get hit by light, dependend on the thickness you give it with the mask, the colour could be another texture or just a solid color.
07-26-2010, 10:55 AM
You should look at what Nvidia did in their 8 series tech demos. Anything here so far has just been a really broad fake of thin object translucency there is no scattering going on at all.. kinda akin to what specular is to reflection.
The Nvidia stuff actually simulates the diffusion with blurred RTT bakes of the objects diffuse lighting and SSS weight maps. its awesome, Shadows and diffuse lighting are diffused in the skin in a pretty accurate manner.(based on real values sampled from human skin)
The Shader VIG posted was based on the Nvidia method but it uses blurred normal maps instead of RTT (no shadow diffusion)
07-26-2010, 11:25 AM
Is this the one r_fletch_r
07-26-2010, 12:11 PM
Whats also nice is they're actually concerned with preservation of Energy levels and correct gamma.
07-26-2010, 01:22 PM
Yeah I saw the deal about gamma. On fxphd, if you look at the course mental ray techniques, a nice talk about gamma there. Didnt even know about that!
07-26-2010, 01:41 PM
Zap is a legend. I'm enrolled in that course at the moment. If you have the time you should do it. the information there so far isnt really mentalray specific its all about light and rendering.
07-27-2010, 10:35 AM
Nielsen, any idea how to prevent your SSS hack making leaves glow when you look at them when the sun/light is directly behind you. I'm no good at math, especially anything vector related :P
07-28-2010, 01:08 AM
Hm, that is not happening to me at all.
Can you post a screenshot of both your network and the actual problem?
07-28-2010, 05:52 AM
Actually I think it was because I didn't use a normal map texture, I just used the light and camera vector dot product. And with trees I used transmission masks that were boosted beyond 1 (brightness that is), same thing with colour. I just multiplied the SSS mask with a 3-vector constant before plugging it into transmission colour.
vBulletin® v3.8.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.