Showing posts with label Shader. Show all posts
Showing posts with label Shader. Show all posts

2 Mar 2014

Test with Uncharted 2 Tonemapping + simple color correction on Project Anarchy Demo.

Added tone mapper from Uncharted 2 to the demo.
Using modified tenderer with hdr , gamma correction and msaa x4.

Figuring out how parameters change the tonemapper curve shape is not really intuitive, but is one of the best I have seen for flexibility.

This is a filmic tone mapper so made to simulate the response curve of a real film,but you can customise this cuve a lot.

There is no perfect tone mapper and seeing it as something just to make all the details pop from the hdr render buffer in some "scientific way" is very limited so i tend to like more customisable ones especially this one.

It is a real artistic tool that makes very different looks possible so I think that is good to expose and play with all curve parameters,even not physically plausible ones, so that different looks can be achieved.

You can also selectively give more contrast to specific parts of the dynamic range and or introduce clipping at will :)

It is an RGB tone mapper so it doesn't just work just on Luminosity and some saturation can get lost in the process.

I use the same curve for all channels but I also want to try with different curve per channel to see if it is pratical and what results can be obtained.

Currently i just added a channel scale and bias for color correction and the saturation control to the shader to desaturate the scene at will or recover some of the lost saturation.

Here with various parameters to make some fast styles made totally by this post effect.
It would be great to test with dynamic daylight a procedural sky.

Actually I don't have any real time soft shadows, nor the sky shader(as both are only provided in the full version).





24 Feb 2014

Project Anarchy improve the Glow Post Processing.

Time ago I tested the glow shader and noticed it isn't as slow as I  believed on mobile if you mantein a low number of iterations.

It actually use dependent texture read so maybe it can be further improved.(p.s. comment in shader says it doesn't really use dependent texture read even if shader it a bit harder to follow in all it's permutations).
Actual implementation seem to do 3 interpolated taps so probably my blur cannot be faster than that, at least for few iterations( i have to see if I can make a better blut with 1 pass and 5 or 6 taps).

I want to implement one with vertex shader interpolators instead to compute uv in pixel shader.

Glow is composed by the most % by a blur filter.

In the actual pipeline this blur is just used in the last glow pass where it merges with the scene.

I don't really like this choice so instead to simply change the shader I want to modify the post processing so that blur can be used multiple time and glow get calculated and added to the scene with other effects and not in it's own pass.

For the blur:

I have to check the max number of texture coordinates ( opengl es limit is of 32 float varings) , but on mobile better to stay within 8 texture coordinates.

I have two 2 main options.


  • A Separable gaussian blur with 5 to 8 taps linear filtered.



  • A 3Pass box blur up to 8 taps (linear filtered) with shape similar to gaussian after the third pass.
First task so will be to complete the blur shader.


.