Browse Source

Initialized resolution uniform by canvas size

gam0022 7 years ago
parent
commit
4b4a6dd558
1 changed files with 1 additions and 1 deletions
  1. 1 1
      examples/webgl_raymarching_reflect.html

+ 1 - 1
examples/webgl_raymarching_reflect.html

@@ -295,7 +295,7 @@
 				geometry = new THREE.PlaneBufferGeometry( 2.0, 2.0 );
 				geometry = new THREE.PlaneBufferGeometry( 2.0, 2.0 );
 				material = new THREE.RawShaderMaterial( {
 				material = new THREE.RawShaderMaterial( {
 					uniforms: {
 					uniforms: {
-						resolution: { value: new THREE.Vector2( 512, 512 ) },
+						resolution: { value: new THREE.Vector2( canvas.width, canvas.height ) },
 						cameraWorldMatrix: { value: camera.matrixWorld },
 						cameraWorldMatrix: { value: camera.matrixWorld },
 						cameraProjectionMatrixInverse: { value: new THREE.Matrix4().getInverse( camera.projectionMatrix ) }
 						cameraProjectionMatrixInverse: { value: new THREE.Matrix4().getInverse( camera.projectionMatrix ) }
 					},
 					},