return max(0.0, dot(norm, v) - m_Bias) * ( 1.0/(1.0 + d) ) * m_Intensity;\r
}\r
\r
-vec4 getColor(in float result){\r
-\r
- if(m_UseOnlyAo){\r
- return vec4(result,result,result, 1.0);\r
- }\r
- if(m_UseAo){\r
- return texture2D(m_Texture,texCoord)* vec4(result,result,result, 1.0);\r
- }else{\r
- return texture2D(m_Texture,texCoord);\r
- }\r
-\r
-}\r
-\r
vec2 reflection(in vec2 v1,in vec2 v2){\r
vec2 result= 2.0 * dot(v2, v1) * v2;\r
result=v1-result;\r
vec3 position = getPosition(texCoord);\r
//optimization, do not calculate AO if depth is 1\r
if(depthv==1.0){\r
- gl_FragColor=getColor(1.0);\r
+ gl_FragColor=vec4(1.0);\r
return;\r
}\r
vec3 normal = getNormal(texCoord);\r
ao += doAmbientOcclusion(texCoord + coord2 * 0.50, position, normal);\r
ao += doAmbientOcclusion(texCoord + coord1.xy * 0.75, position, normal);\r
ao += doAmbientOcclusion(texCoord + coord2 * 1.00, position, normal);\r
-\r
}\r
ao /= float(iterations) * 4.0;\r
- result = 1.0-ao;\r
-\r
- //gl_FragColor=getColor(result);\r
+ result = 1.0 - ao;\r
\r
- gl_FragColor=vec4(result);\r
+ gl_FragColor=vec4(result);\r
}
\ No newline at end of file