From 44010974fc19ecddcc4b3b259ff2664434bed9d3 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 10 Dec 2012 12:34:28 +0100 Subject: [PATCH] workaround for HLSL error X4579 --- files/materials/core.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/files/materials/core.h b/files/materials/core.h index e9577bbf3..1c9ea1d1d 100644 --- a/files/materials/core.h +++ b/files/materials/core.h @@ -1,5 +1,6 @@ -#define gammaCorrectRead(v) pow(v, float3(gammaCorrection,gammaCorrection,gammaCorrection)) -#define gammaCorrectOutput(v) pow(v, float3(1.f/gammaCorrection,1.f/gammaCorrection,1.f/gammaCorrection)) +#define gammaCorrectRead(v) pow(max(v, 0.00001f), float3(gammaCorrection,gammaCorrection,gammaCorrection)) +#define gammaCorrectOutput(v) pow(max(v, 0.00001f), float3(1.f/gammaCorrection,1.f/gammaCorrection,1.f/gammaCorrection)) + #if SH_HLSL == 1 || SH_CG == 1