Explorar o código

Initialized resolution uniform by canvas size

gam0022 %!s(int64=8) %!d(string=hai) anos
pai
achega
4b4a6dd558
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  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 );
 				material = new THREE.RawShaderMaterial( {
 					uniforms: {
-						resolution: { value: new THREE.Vector2( 512, 512 ) },
+						resolution: { value: new THREE.Vector2( canvas.width, canvas.height ) },
 						cameraWorldMatrix: { value: camera.matrixWorld },
 						cameraProjectionMatrixInverse: { value: new THREE.Matrix4().getInverse( camera.projectionMatrix ) }
 					},

粤ICP备19079148号