From 72fdf816e78b8b497d91164176215f082b590ff5 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 8 Dec 2014 19:16:26 +0100 Subject: [PATCH] Fix Importance sampling --- data/shaders/importance_sampling_specular.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag index ca3187d82..c997fafb7 100644 --- a/data/shaders/importance_sampling_specular.frag +++ b/data/shaders/importance_sampling_specular.frag @@ -20,8 +20,8 @@ void main(void) for (int i = 0; i < 1024; i++) { - float Theta = texelFetch(samples, 2 * i).r; - float Phi = texelFetch(samples, 2 * i).g; + float Theta = texelFetch(samples, i).r; + float Phi = texelFetch(samples, i).g; vec3 L = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; float NdotL = clamp(dot(RayDir, L), 0., 1.);