Fix Importance sampling

This commit is contained in:
Vincent Lejeune 2014-12-08 19:16:26 +01:00
parent 2b0680d92d
commit 72fdf816e7

View File

@ -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.);