Eevee: Render: Fix NaNs in Normal pass.

This commit is contained in:
Clément Foucault 2018-02-02 00:48:33 +01:00
parent 44c4d62092
commit 9173a6f519
1 changed files with 5 additions and 0 deletions

View File

@ -233,6 +233,11 @@ static void eevee_render_result_normal(
/* Convert Eevee encoded normals to Blender normals. */
for (int i = 0; i < rr->rectx * rr->recty * 3; i += 3) {
if (rp->rect[i] == 0.0f && rp->rect[i+1] == 0.0f) {
/* If normal is not correct then do not produce NANs. */
continue;
}
float fenc[2];
fenc[0] = rp->rect[i+0] * 4.0f - 2.0f;
fenc[1] = rp->rect[i+1] * 4.0f - 2.0f;