My tweaks to SSAO, to improve randomness and final blending
This commit is contained in:
parent
083c2d42bd
commit
30011be115
@ -17,5 +17,6 @@ void main(void)
|
||||
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
|
||||
float ao = texture(SSAO, tc).x;
|
||||
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent * (1. - color.a);
|
||||
FragColor = vec4(color.xyz * LightFactor * ao, 1.);
|
||||
FragColor = vec4(color.xyz * LightFactor * (0.4 + ao*0.6), 1.);
|
||||
//FragColor = vec4(color.xyz * LightFactor, 1.);
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ const float invSamples = strengh / SAMPLES;
|
||||
|
||||
vec3 rand(vec2 co)
|
||||
{
|
||||
return texture(noise_texture, co).xyz;
|
||||
return texture(noise_texture, co*20).xyz;
|
||||
}
|
||||
|
||||
void main(void)
|
||||
|
@ -547,7 +547,7 @@ void PostProcessing::renderSSAO(const core::matrix4 &invprojm, const core::matri
|
||||
glUniform1i(FullScreenShader::SSAOShader::uniform_normals_and_depth, 0);
|
||||
|
||||
if (!noise_tex)
|
||||
noise_tex = irr_driver->getTexture(file_manager->getAsset("textures/tarmac.jpg").c_str());
|
||||
noise_tex = irr_driver->getTexture(file_manager->getAsset("textures/noise.png").c_str());
|
||||
glActiveTexture(GL_TEXTURE1);
|
||||
glBindTexture(GL_TEXTURE_2D, static_cast<irr::video::COpenGLTexture*>(noise_tex)->getOpenGLTextureName());
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
Loading…
x
Reference in New Issue
Block a user