• 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
BlinksTale

"Soft" shader, or, how do I get this skin-lighting effect?

10 posts in this topic

You guys always know how to pull off these fancy tricks, so perhaps you can help me with this. Nintendo's newest round of games all have this amazing "soft" look to them visually, no more [url=http://i.imgur.com/AfDGgae.jpg]hard light-to-dark gradients[/url]. Instead, there's backlighting or that layered skin effect, underlighting, *something*. That's what I'm trying to figure out, and then how to do it.

 

Examples:

 

w7GX0Vd.jpg

Kirby here, and maybe Pikachu's chest just under his arm.

 

r1ntijA.jpg

These two cube men, with some ridiculously soft lighting/shadowing system, although I think it might be different from the others.

 

JU8oT4L.jpg

The back of this girls head, just under her hairline. It definitely glows, but only at the edge of her head.

 

XfzRrtZ.jpg

Here Pascal, the red otter, has the glow all around his head. The girl also has it, but on her jawline.

 

So I'm guessing the glow is a reflection, due to what fancy-schmancy art class still life taught me.

 

ox3oze9.gif

^art skewl

 

Although I'm also inclined to think it's a skin transparency layering mimicking thing, like the PS4 demo by David Cage (only significantly cheaper on the processor, I'm sure).

 

And I still think that Cube Men one is a different shader/lighting/thing altogether, but I don't know how to describe it compared to the others.

 

So, thoughts? Directions? Help? I want my game to have friendly, soft, and welcoming visuals. So far, all of the above do an excellent job of that, so I'd like to learn what I can from them. Many thanks!

Edited by BlinksTale
1

Share this post


Link to post
Share on other sites

All the examples except the cube men are in my opinion just faked rim lights. The basic idea is to add light in regions where the eye and surface normal are roughly perpendicular. The Unity example posted by TiagoCosta implement this technique. This technique does not simulate some kind of reflection but the effect of the back (or rim) light in the three point lighting system used in traditional art. I suggest learning about it. This kind of lighting is for example used to highlight the actors separating them from the background. 

1

Share this post


Link to post
Share on other sites

Maybe you could took a look at that Valve publication about Team Fortress 2 where they go in detail about character lighting. Does this qualify for what you want?

2

Share this post


Link to post
Share on other sites

s6ft.png

 

Here is a GLSL shader called 'X-ray' that was published by ATI.  I think if you configure it a bit you may be able to achieve the effect you are looking for.

 

 

 

 

//============VERTEX SHADER

 

varying vec3 Normal; varying vec3 invertPosition; varying vec4 Color; void main() {  vec4 Position = gl_ModelViewMatrix * gl_Vertex;    invertPosition  = Position.xyz - vec3(0);  //_____This vec3(0)is not doing anything but I left in in so you can see what was originally in the shader    Normal  = gl_NormalMatrix * gl_Normal;    Color = vec4(0.1, 0.2, 0.3, 1.0);    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;   } //==================================================

 

//===========FRAGMENT

 

varying vec3 Normal; varying vec3 invertPosition; varying vec4 Color; // globals float edgefalloff = -1.0; // entry point void main() {   float opac = dot(normalize(-Normal), normalize(-invertPosition));   opac = abs(opac);   opac = 1.0-pow(opac, edgefalloff);   opac = 1.0 - opac;     //Cs = dot(opac, Color);     gl_FragColor =  opac * Color;   gl_FragColor.a = opac; }  

1

Share this post


Link to post
Share on other sites

It looks to me that those screenshots mostly show off similar, but not necessarily identical, effects. In particular, the third ones look like they achieve the "softness" mostly in a way that isn't viewing-angle sensitive (they both also seem to show specular lighting with a low specular power, but it's not necessarily anything special). The second one looks like it has a lot of ambient/environment light to give it the softness.

 

The first and fourth ones seem to show off lighting that gets brighter as the incident angle is more perpendicular to the camera; as mentioned there are a lot of ways to achieve this; the NVIDIA Shader Library has some "velvet" and "fuzz" materials that might be of use.

 

If you just want to play with some common algorithms, Blender supports a few shading models with its internal renderer; you might look at Minnaert (with a <1 "darkness" value) and Fresnel for viewing-angle sensitive lighting, and Oren-Nayar for a "rougher" (relative to Lambert), but still purely diffuse material.

 

Finally, if you specifically want the "skin transparency layering mimicking thing" the keyword to look for is "subsurface scattering"; to my knowledge the most common way to fake this in real time is to sum layers made by blurring the lighting in UV space.

 

EDIT: Wrote "blending modes" where I didn't mean to write "blending modes" at all.

EDIT: Wrote <0 when I meant <1

Edited by cowsarenotevil
1

Share this post


Link to post
Share on other sites

Fuzz edge is definitely the effect I was looking for (very similar to velvet though), which looks to be a variant of rim lighting, and the wrap diffuse lighting will help too! Thank you all, this is far more than I could have asked for :)

0

Share this post


Link to post
Share on other sites
Half Life 2 used a "Half Lambert" diffuse term

 

Yup, another excellent formula.  I saw this half life formula described as "the dot product from the Lambertian model is scaled by ½, add ½ and squared"

 

I interpreted this as the following -> ((NdotL1 * 0.5) + 0.5) * ((NdotL1 * 0.5) + 0.5) 

 

The model looks very similar as with the above RenderMan equation but this one better retains the illusion of depth.  Thanks for the tip.

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