Browse Source

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

sunag 3 months ago
parent
commit
3507b2b862
2 changed files with 6 additions and 6 deletions
  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号