Skip to content

Commit 10cf6bc

Browse files
committed
Examples: Consider pixel ratio in FXAA demo for fxaa uniforms
1 parent d2ea94f commit 10cf6bc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/webgl_postprocessing_fxaa.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@
138138
fxaaPass = new THREE.ShaderPass( THREE.FXAAShader );
139139
fxaaPass.renderToScreen = true;
140140

141-
fxaaPass.material.uniforms[ "resolution" ].value.x = 1 / window.innerWidth;
142-
fxaaPass.material.uniforms[ "resolution" ].value.y = 1 / window.innerHeight;
141+
fxaaPass.material.uniforms[ "resolution" ].value.x = 1 / ( window.innerWidth * window.devicePixelRatio );
142+
fxaaPass.material.uniforms[ "resolution" ].value.y = 1 / ( window.innerHeight * window.devicePixelRatio );
143143

144144
composer1 = new THREE.EffectComposer( renderer );
145145
composer1.addPass( renderPass );
@@ -169,8 +169,8 @@
169169
composer1.setSize( window.innerWidth, window.innerHeight );
170170
composer2.setSize( window.innerWidth, window.innerHeight );
171171

172-
fxaaPass.material.uniforms[ 'resolution' ].value.x = 1 / window.innerWidth;
173-
fxaaPass.material.uniforms[ 'resolution' ].value.y = 1 / window.innerHeight;
172+
fxaaPass.material.uniforms[ 'resolution' ].value.x = 1 / ( window.innerWidth * window.devicePixelRatio );
173+
fxaaPass.material.uniforms[ 'resolution' ].value.y = 1 / ( window.innerHeight * window.devicePixelRatio );
174174

175175
}
176176

0 commit comments

Comments
 (0)