A typical unlit scene - the starting point for all rendering
Alas I am not prepared to delay the project further by implementing a whole HDR system as it would require a lot of texture and shader updating, and adding texture referencing in my shaders is the last thing I want to do after making such good strides in performance. The solution was to achieve everything I wanted but without using the above techniques. As at 2:30PM I have achieved these goals, and am ahead of schedule by a day :)
The solution to the tone mapper was what I am calling my auto-magical exposure feature, which is very similar to adaptive bloom and acts on the post process shader to ensure a scene compensates for being over bright. Added some code to use the time delta from the engine and it now adjusts at the same speed as the human iris which creates a nice subtle effect. Look at the sky and your eyes adjust, look at something dark and the eyes adjust again, look back at the sky quickly and notice how the eyes adjust over 1-2 seconds. Very cool!
The second solution was to dump reading the skybox (even a small 1x1 per side version of it), and simply pre-scan the colour of the sky and the colour of the floor, and load those directly into the shader as a constant. I then use a spherical harmonics trick to work out the contributions based on the surface normal presto, the ambience now has the visual effect of receiving bounced light. It's not sophisticated, but it's completely free and super fast!
Notice how the ambience is taken from the sky and terrain colour
When combined with the remaining pixel shader it blends with the scene
Không có nhận xét nào:
Đăng nhận xét