How can i have a softer Skin using BRDF

Started by
18 comments, last by MJP 9 years, 9 months ago

Are you using self shadowing in these screenshots?

SlimDX | Ventspace Blog | Twitter | Diverse teams make better games. I am currently hiring capable C++ engine developers in Baltimore, MD.
Advertisement

Hi,

Now, i implemented Pre Integrated SSS, so i use curvature and BRDF lookup but i have a new problem :

the SSS have ugly artifacts, and i don't know why. I tried to use a smaller mip map but it doesn't resolve the problem.

1404506798-bad-sss.jpg

You can see the SSS is pretty hard, with a "polygon" look.

After that, i tried to do a pow(2.2) on the lookupsample, and there is less artifacts but it's incorrect(the falloff is not linear).

I also have some banding.

The look-up table is data, not imagery, and should not be “converted” to any spaces (including linear).

It would appear that you have a problem with normals. How does the model render normally?

L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Looks to me like your curvature map is simply rubbish.

It's not a problem of normal :

1404570573-normal-good.jpg

Normals are ok.

And about the curvature, i calculate it dynamically using :

length( fwidth(WorldNormal) ) / length( fwidth (worldPos ) );

I'm manually correcting gamma by doing pow(2.2) on input (Albedo) and pow(1/2.2) on output.

When i remove this (so without gamma correction) it looks like it should (but its in gamma).

So i found a compromise which is i do gamma correction AFTER brdf calculations.

So the code looks like this :


half3 falbedo = tex2D(_MainTex,uv);
float ndotl = dot(s.blurNormal,lightDir);
lookUpPos.x = ndotl * 0.5 + 0.5;
lookUpPos.y = curvature * lightIntensity;
float3 dif = tex2D (_BRDFLookUp, lookUpPos).xyz;
fAlbedo*=dif;
float3 final = (pow(fAlbedo,2.2) + spec) * _LightColor0.rgb * (attenuation * 2);
return float4(final,1);

I know that it's not correct but i found nothing else.

If you calculate your curvature map using screen space derivatives of lerped normals then it is only to be expected that the curvature values are constant over individual polygons. Normalizing your normals beforehand could help a bit, I'm not sure how much though.

EDIT: Ok, the prob is that you have to consider the change in position too, which is constant over triangles anyways.

When i do :

length( fwidth(normalize(WorldNormal) ) ) / length( fwidth (worldPos ) );

it changes nothing.

Also, i'm using Unity's Surface Shaders, which compute normals automatically. Normal map is also taken in account.

I don't know how can i smooth them. It's also strange that the SSS effect works well when i do BRDF before gamma correction and looks ugly when i do gamma correction on input.

PS : You think Cook Torrance with GGX is good for skin specular or i should move to Kelemen/Szirmay-Kalos ?

In my experience you really need to use curvature maps for the pre-integrated shading. The trick with using derivatives and clever and might work for certain simple scenarios, but the fact it has discontinuities across triangle edges is pretty much a deal-breaker for faces.

@MJP: Do you use a single curvature map regardless of facial animations?

Yeah we always use the same map, we don't animate it.

This topic is closed to new replies.

Advertisement