Another ssao tweak.

This commit is contained in:
vlj 2014-04-20 02:56:07 +02:00
parent e8b36f2490
commit 878a639a84

View File

@ -13,7 +13,7 @@ varying vec2 uv;
#define AO gl_FragColor.x #define AO gl_FragColor.x
#endif #endif
const float strengh = 3.; const float strengh = 5.;
const float radius = 1.f; const float radius = 1.f;
#define SAMPLES 16 #define SAMPLES 16
@ -22,7 +22,9 @@ const float invSamples = strengh / SAMPLES;
vec3 rand(vec2 co) vec3 rand(vec2 co)
{ {
return texture(noise_texture, co * pow(3.14159265359, 2.)).xyz; float noiseX = clamp(fract(sin(dot(co ,vec2(12.9898,78.233))) * 43758.5453),0.0,1.0)*2.0-1.0;
float noiseY = clamp(fract(sin(dot(co ,vec2(12.9898,78.233)*2.0)) * 43758.5453),0.0,1.0)*2.0-1.0;
return vec3(noiseX, noiseY, length(texture(noise_texture, co * pow(3.14159265359, 2.)).xyz));
} }
vec3 DecodeNormal(vec2 n); vec3 DecodeNormal(vec2 n);