Skip to content

Commit

Permalink
Apply gamma correction to sky
Browse files Browse the repository at this point in the history
Signed-off-by: ahcorde <[email protected]>
  • Loading branch information
ahcorde committed Mar 25, 2021
1 parent 88cfd40 commit bc12f40
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ogre2/src/media/materials/programs/skybox_fs.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,7 @@ void main()
{
// Cubemaps are left-handed
fragColour = texture( skyCubemap, vec3( inPs.cameraDir.xy, -inPs.cameraDir.z ) ).xyz;
// apply gamma correction
float gamma = 2.2;
fragColour.rgb = pow(fragColour.rgb, vec3(1.0/gamma));
}

0 comments on commit bc12f40

Please sign in to comment.