LightScatteringFilter : changed the way the light shafts are blended into the original scene.

git-svn-id: https://jmonkeyengine.googlecode.com/svn/branches/gradle-restructure@11056 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
rem..om 2014-02-16 13:44:17 +00:00
parent 8e65f333d8
commit f3457c2f52
2 changed files with 4 additions and 2 deletions

View File

@ -29,7 +29,8 @@ void main(void)
res /= m_NbSamples; res /= m_NbSamples;
//Blend the original color with the averaged pixels //Blend the original color with the averaged pixels
gl_FragColor =mix( colorRes, res, m_LightDensity); float mean = (res.r + res.g + res.b)/3;
fragColor =mix(colorRes ,mix( colorRes, res, m_LightDensity),mean);
}else{ }else{
gl_FragColor= texture2D(m_Texture,texCoord); gl_FragColor= texture2D(m_Texture,texCoord);
} }

View File

@ -33,7 +33,8 @@ void main(void)
res /= m_NbSamples; res /= m_NbSamples;
//Blend the original color with the averaged pixels //Blend the original color with the averaged pixels
fragColor = mix( colorRes, res, m_LightDensity); float mean = (res.r + res.g + res.b)/3;
fragColor =mix(colorRes ,mix( colorRes, res, m_LightDensity),mean);
}else{ }else{
fragColor = getColor(m_Texture,texCoord); fragColor = getColor(m_Texture,texCoord);
} }