Hey,
Recently I've done some exploration on the environment shaders for Freja's Journey.
I find it a bit hard working with many images on forums so you can see this post on my Personal Production Forum as well where I can customize the layout a bit more: http://www.adrianlazar.com/2013/07/22/frejas-journey-l05-environment-art-wip-01/We knew pretty much from the beginning the general direction on how our game should look so the test was more about curiosity and finding possible variations rather than a change of style.
We won't use normal maps or specular shaders for the environment so what I'm looking for is a more general purpose shader that can work well on all kind of surfaces, being rock, wood or metal and serve the artstyle we need.
Here is just the first test in an area that requires a lot more research so we weren't able to draw any definitive conclusions but I thought it might be interesting to share the findings.
Here's a short video showing the different shaders used in this test (click on the pictures to play):(Is there a way to embed video?)
For my test I've used a few props that Alina and
Mads textured, kept the set-dressing, lighting and effects and changed only the shaders.
These are really, really quick tests and some of the shaders made especially for this are a bit rough around the edges so it's possible to see a few artifacts. While the possibilities are almost endless, I limited this test to only 3 shaders, Unlit, Rim-Light and Fake BRDF.
Unlit ShaderBelow is the default version, an Unlit Shader that supports lightmaps.
This shader is completely neutral, with only the diffuse texture and the lightmaps affecting the final look of the props.
Even though we're using a very simple shader, the scene looks cozy because most of the props are textured and
Silvia put a lot of effort in lighting, using not just Global Illumination but also many rim and fill lights that we generated lightmaps from.
It shows that even a basic shader can deliver good results if the props and lighting are done with care.
Rim-Light ShaderHere is a Rim-light Shader that I made to be used mainly on effects and special props.
It can tint differently the base texture and the view-depended rim-light color, and used here it adds a soft look to the environment by brightening a bit the edges of the objects, thus reducing contrast.
A similar effect could've been done in lighting as well but it would require a lot of work in placing the rim lights. The implementation would also be quite rigid, for example if you move the props to tweak the set-dressing you'll need to move all the rim-lights as well. We anyway have to do that but on a very small scale compared to if we would try to simulate in lighting the same result as below.
Something to notice with the Rim-Light Shader is that it can reduce the overall color diversity in the final image since the rim-light can have only one color. If we compare the color palette for this version with the one from the unlit we can see this happening.
Another effect to be aware of is brightening / over-exposing the image and that's because the rim-light of the shader is additive to the diffuse texture and lightmaps.
The Unlit version is placed next for comparison. Fake BRDF Shader Var 01Next I made a basic Fake BRDF Shader that offers an extra layer of control.
This fragment shader combines the diffuse texture with the lightmaps and uses a custom lighting function which takes a lookup texture to define how the light affects the object - the lookup texture usually being two gradients, one running vertically while the other is horizontal. The lighting function takes into account both the viewing direction and the light direction thus offering more flexibility to define the final color output of the shader.
As opposed the rim-light shader, using a Fake BRDF in the typical way will most likely result in an increase of hues in the image since now we have better control over the how shader reacts to both view and lighting direction. Of course making the gradient completely one color will produce an almost mono tone result.
Since it has such a deep effect on lighting, a Fake BRDF Shader can radically change the way the scene looks and having this extra layer of controlling the final image can be both a blessing and a curse.
Between textures, lighting, environment effects and complex shaders, it's easy to get lost in all the components that are affecting how the game will look. So if we're going to use a Fake BRDF Shader on the environment for Freja's Journey will most likely be as a final touch, adding just a little extra to the scene.
In the example below you can see that using this shaders adds a cyan and an orange hue to the color palette, compared to the unlit one. It also does a good job in simulating more color bouncing happening in the scene.
Again, the Unlit shader is placed next for comparison.
Fake BRDF Shader Var 02Below is the same Fake BRDF Shader but with a different gradient. This time I used a more monochromatic texture with brown as the dominant color and now it has the opposite effect, instead of creating a more colorful result it creates one with less color diversity.
Everything else in the scene is exactly the same as in the Unlit version.
Fake BRDF Shader Var 03Since the Fake BRDF Shader can affect the final image in so many ways I had to make one more variation, this time going for something a bit more surreal by adding a slight tint of red.
It's not a result that I particularly like since I believe it breaks the color scheme but it shows how different you can make the image by changing only the gradient texture used by the shader.
Toon ShaderOut of pure curiosity I've tested the scene with a Toon Shader. I don't think it looks bad at all but it's definitely not something we want for our game
Still, shows that by just changing the shader you can radically alter the look of a game.
And here are all the shaders used in this short test together for an easy comparison.
As I was saying in the beginning, finding a suited shader for the environment is a task that will require many tests and this is just the first step so no decision could have been taken now.
There are unlimited possibilities but we must find a good balance between ease of use, flexibility and performance.
Hope you found it interesting,
- Adrian