Posted 24 May 2012 - 10:43 PM
Posted 25 May 2012 - 12:14 AM
There's also the shader set I'm working on and posting here on devmaster. It's slowly coming along, but serves as a ground zero place to test and learn shaders via WebGL. Someday it will be a large collection of useful stuff. The next one on depth of field should be posted soon and I'll be working on gamma correction next since someone made a request for it.
Posted 26 May 2012 - 03:57 AM
Also, would the shader libraries you mentioned above be easily incorporated into Unity? That's what I'm really starting to get into, commit to, and I'm starting to learn the shader ropes within Unity. I'd like to know how easy it'd be to pop those shaders into Unity.
Posted 26 May 2012 - 04:25 AM
Posted 26 May 2012 - 11:35 AM
The shaders you find online will almost never be interoperable as-is. As you may know, shaders are only half the problem. The other half lies in the implementation of the API. Everybody has their own way of doing things and this affects how you integrate shaders into your engine. Some shaders may require multiple passes and special handling, such as with shadow mapping. Render the depth, render the blur, render the scene, etc. Other shaders may require specific information such as tangent, binormal, and normal data for computing tangent-space bump mapping. Skinning shaders will require bone data and bone matrices. So there's a lot of glue code that needs to be done, and that's where the bulk of shader development happens.
Toon shading, also called cel-shading, is a pretty neat result and quite simple to achieve the basics. If you read my shader series article on basics of lighting, you will have read about the Lambert equation for calculating diffuse lighting. Simply put, if you modulate that result to limit the shades of grey to something like 10 values (instead of the normal 256), you produce a coarse gradient that simulates toon lighting. When combined with vibrant textures or colours, it starts to take face. This is of course the basics and some additional work is required if you want to fine-tune it and add outlines. Keep in mind that textures play a large role in cel-shading as well. Take a close look at Windwalker and you will note the environment does not have any lighting. Those are pre-calculated textures designed to give that look. I believe only the characters and interactive objects are cel-shaded. So textures play a big role here. Taking a photograph of bark on a tree and dumping that into your cel-shaded game is not going to look good.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users