Improve depth interpolation in reference renderer
authorPyry Haulos <phaulos@google.com>
Tue, 24 Feb 2015 23:42:31 +0000 (15:42 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 24 Feb 2015 23:42:31 +0000 (15:42 -0800)
commitf4238ec8ad0e9b0995142dc3b0b9a18de167ae3f
treed47fde1bfcf4f5f5eddb129025e2a036eb8cfd5f
parent0a3b01c9060322986341f27c8bf0e6261a7d4049
Improve depth interpolation in reference renderer

This change reformulates depth value interpolation to exactly preserve
constant depth across a triangle. Old interpolation code exhibited
serious Z-fighting with two (Z-)overlapping screen-aligned triangles.

In addition barycentric precision is slightly improved by actually
dividing with the sum instead of sharing pre-computed 1/sum.

A simple test for constant depth and varying interpolation is provided.

Change-Id: If6229f9652bcf3dbe1d273ed8e131b175c06dfc2
framework/referencerenderer/rrRasterizer.cpp
framework/referencerenderer/rrVertexAttrib.hpp
modules/internal/CMakeLists.txt
modules/internal/ditFrameworkTests.cpp