Skip to content

Commit

Permalink
Merge pull request #1 from bhouston/dev-gamma
Browse files Browse the repository at this point in the history
Dev gamma
  • Loading branch information
WestLangley committed Mar 18, 2015
2 parents 9793da8 + 8d83e0e commit e5fed34
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 0 additions & 2 deletions examples/js/shaders/ToneMapShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ THREE.ToneMapShader = {
"vec4 texel = texture2D( tDiffuse, vUv );",

"gl_FragColor = vec4( ToneMap( texel.xyz ), texel.w );",
//Gamma 2.0
"gl_FragColor.xyz = sqrt( gl_FragColor.xyz );",

"}"

Expand Down
11 changes: 6 additions & 5 deletions examples/webgl_shaders_tonemapping.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<script src="js/shaders/LuminosityShader.js"></script>
<script src="js/shaders/ConvolutionShader.js"></script>
<script src="js/shaders/ToneMapShader.js"></script>
<script src="js/shaders/GammaCorrectionShader.js"></script>

<script src="js/postprocessing/EffectComposer.js"></script>
<script src="js/postprocessing/RenderPass.js"></script>
Expand Down Expand Up @@ -368,27 +369,27 @@
ldrToneMappingPass = new THREE.AdaptiveToneMappingPass( false, 256 );
hdrToneMappingPass = new THREE.AdaptiveToneMappingPass( false, 256 );
bloomPass = new THREE.BloomPass();
var copyPass = new THREE.ShaderPass( THREE.CopyShader );
copyPass.renderToScreen = true;
var gammaCorrectionPass = new THREE.ShaderPass( THREE.GammaCorrectionShader );
gammaCorrectionPass.renderToScreen = true;

dynamicHdrEffectComposer.addPass( skyboxPass );
dynamicHdrEffectComposer.addPass( scenePass );
dynamicHdrEffectComposer.addPass( adaptToneMappingPass );
// dynamicHdrEffectComposer.addPass( debugPass );
dynamicHdrEffectComposer.addPass( bloomPass );
dynamicHdrEffectComposer.addPass( copyPass );
dynamicHdrEffectComposer.addPass( gammaCorrectionPass );

hdrEffectComposer.addPass( skyboxPass );
hdrEffectComposer.addPass( scenePass );
hdrEffectComposer.addPass( hdrToneMappingPass );
hdrEffectComposer.addPass( bloomPass );
hdrEffectComposer.addPass( copyPass );
hdrEffectComposer.addPass( gammaCorrectionPass );

ldrEffectComposer.addPass( skyboxPass );
ldrEffectComposer.addPass( scenePass );
ldrEffectComposer.addPass( ldrToneMappingPass );
ldrEffectComposer.addPass( bloomPass );
ldrEffectComposer.addPass( copyPass );
ldrEffectComposer.addPass( gammaCorrectionPass );

// var gammaPass = new THREE.ShaderPass( GammaShader );
// gammaPass.renderToScreen = true;
Expand Down

0 comments on commit e5fed34

Please sign in to comment.