|
@@ -66,8 +66,12 @@ class SAO extends ScreenShader {
|
|
|
var normal = normalTexture.get(vUV);
|
|
|
|
|
|
var noiseUv : Vec2;
|
|
|
- noiseUv = useWorldUV ? origin.xy + origin.z : vUV / screenRatio;
|
|
|
- var sampleNoise = noiseTexture.get(noiseUv * noiseScale).x;
|
|
|
+ if( useWorldUV )
|
|
|
+ noiseUv = (origin.xy + origin.z) * noiseScale;
|
|
|
+ else
|
|
|
+ noiseUv = vUV / screenRatio * noiseScale;
|
|
|
+
|
|
|
+ var sampleNoise = noiseTexture.get(noiseUv).x;
|
|
|
var randomPatternRotationAngle = 2.0 * PI * sampleNoise;
|
|
|
|
|
|
// change from WS to DepthUV space
|