• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
toto5100

How can i have a softer Skin using BRDF

19 posts in this topic

Hi,

i implemented physically based shading, using the Cook Torrance BRDF Equation, with Trowbridge Reitz GGX for Normal Distribution, the Smith Schlick GGX for Geometric Shadowing, Schlick Approximation for Fresnel and for diffuse, Lambert.

All is working in Linear Space with pow(2.33) on Input and pow(0.4545) on output, and it looks good.

But the problem i have is for skin :

[attachment=22294:Skin harsh.jpg]

The falloff is too harsh, good for general objects, but the skin should look softer.

And it looks like cell shading...

So how can i make it softer like this :

crysis3-2013-01-22-10-57-22-06.jpg

1

Share this post


Link to post
Share on other sites

@Promit Yes, the falloff is very harsh, and without specular too (it stay the same). Do you know another diffuse equation i can use to have something softer ?

@kauna It's because Unity Free have his inputs in Gamma Space, so i had to manually correct the gamma in shaders.

 

I will try Sub Surface Scaterring, but i cant' use a method in Screen Space or anything which needs a rendertexture : in free version, rendertexture are very expensive.

So i'll try the Pre-Integrated Skin Shading but i have some questions :

if i understood well, i need my usual textures :

- Albedo, Normal map, Specular Map, Gloss Map

and

- Curvature Map (Baked from the mesh) and BRDF look up

So this method only affect diffuse calculations right ?

I can keep my Cook Torrance Specular, i just have to modify classic Diffuse Lambert to add SSS ?

0

Share this post


Link to post
Share on other sites
Will sub-surface scattering necessarily help the falloff though? You can however get good skin results with nice ambient occlusion, SSS, a subtle texture map, and a decent normal map.
0

Share this post


Link to post
Share on other sites


@Promit Yes, the falloff is very harsh, and without specular too (it stay the same). Do you know another diffuse equation i can use to have something softer ?
At risk of revealing my mountain man situation of being trapped on mobile ... I just like gamma space half lambert, as described in the HL2 slides.
	float ndotl = dot(N, L1);
	//compute half lambert term
	ndotl = (ndotl * 0.5) + 0.5;
	ndotl *= ndotl;
	ndotl = clamp(ndotl, 0.0, 1.0);

1

Share this post


Link to post
Share on other sites

I tested your half lambert, but the problem is the lighting looks flat : the falloff is very large, so it looks incorrect, especially with shadows.

I tried to downscale the normal map, and the result is a little softer, but it's still very harsh.

[attachment=22313:Image based Lighting Woman Harsh 2.jpg]

I'll try pre integrated sss too.

Someone knows where i can download the head scan all people use ? The Infinite site is down :(

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

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.

Edited by toto5100
0

Share this post


Link to post
Share on other sites

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.

Edited by Tasty Texel
0

Share this post


Link to post
Share on other sites

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 ?

Edited by toto5100
0

Share this post


Link to post
Share on other sites

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.

 

1

Share this post


Link to post
Share on other sites

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

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0