瀏覽代碼

Examples: Fix chromatic aberration type usage of caustics example (#32169)

sunag 8 月之前
父節點
當前提交
3507b2b862
共有 2 個文件被更改,包括 6 次插入6 次删除
  1. 3 3
      examples/webgpu_caustics.html
  2. 3 3
      examples/webgpu_volume_caustics.html

+ 3 - 3
examples/webgpu_caustics.html

@@ -122,9 +122,9 @@
 					const chromaticAberrationOffset = normalView.z.pow( - .9 ).mul( .004 );
 
 					const causticProjection = vec3(
-						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.x.negate(), 0 ) ) ).r,
-						texture( causticMap, textureUV.add( vec2( 0, chromaticAberrationOffset.y.negate() ) ) ).g,
-						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.x, chromaticAberrationOffset.y ) ) ).b
+						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.negate(), 0 ) ) ).r,
+						texture( causticMap, textureUV.add( vec2( 0, chromaticAberrationOffset.negate() ) ) ).g,
+						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset, chromaticAberrationOffset ) ) ).b
 					);
 
 					return causticProjection.mul( viewZ.mul( 25 ) ).add( viewZ ).mul( causticColor );

+ 3 - 3
examples/webgpu_volume_caustics.html

@@ -122,9 +122,9 @@
 					const chromaticAberrationOffset = normalView.z.pow( - .9 ).mul( .004 );
 
 					const causticProjection = vec3(
-						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.x.negate(), 0 ) ) ).r,
-						texture( causticMap, textureUV.add( vec2( 0, chromaticAberrationOffset.y.negate() ) ) ).g,
-						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.x, chromaticAberrationOffset.y ) ) ).b
+						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset.negate(), 0 ) ) ).r,
+						texture( causticMap, textureUV.add( vec2( 0, chromaticAberrationOffset.negate() ) ) ).g,
+						texture( causticMap, textureUV.add( vec2( chromaticAberrationOffset, chromaticAberrationOffset ) ) ).b
 					);
 
 					return causticProjection.mul( viewZ.mul( 60 ) ).add( viewZ ).mul( causticColor );

粤ICP备19079148号