User Tools

Site Tools


dragengine:modules:opengl:aofresnelreduction

Start Page » Module System » OpenGL Graphic Module » AO Fresnel reduction

Using Physically Based Rendering has also some serious problems. One is the problem of reflections inside cavities or inside inlets. The fresnel reflection causes mirroring behavior even in cavities. This uses unfortunately the environment map nearest to the object resulting in mirrored reflections from the opposite direction of the object which looks wrong (shining highlights). This problem can not be properly solved without using an alternative technique instead of environment maps.

The problem can though be reduced by using a little hack. Cavities and inlets have the distinctive ability that they have an ambient occlusion value less than 1. This ambient occlusion value can be used to reduce the fresnel effect in cavities removing the wrong shining highlight a lot. The ambient occlusion value can be interpreated as a hemi-sphere around the surface point of interest indicating up to what declination from the surface normal a light ray can hit the surface point without being blocked by the walls of the cavity. You can thus derive a formula telling you up to what declination angle lights rays for reflections are valid (can hit and exit the surface point unblocked) for a given ambient occlusion value. The trick is to use the ambient occlusion value as the percentage of the hemi-sphere covered. Using the formula for calculating the surface area of a sphere segment you can calculate then the angle. If a fresnel reflection would result in a mirror light ray ending up outside this cone the fresnel effect is cancelled.

The roughness texture property is also defined to equal to the declination from the surface normal. It is thus used to make the edges of the cone softer.

All together this helps to reduce the aweful shinning effect on cavities and inlets. A better solution will be implement later on.

You could leave a comment if you were logged in.
dragengine/modules/opengl/aofresnelreduction.txt · Last modified: 2012/12/04 21:16 by dragonlord