diff --git a/examples/jsm/tsl/display/PixelationPassNode.js b/examples/jsm/tsl/display/PixelationPassNode.js index 3a1ba7e49ae407..f64adb97f67e47 100644 --- a/examples/jsm/tsl/display/PixelationPassNode.js +++ b/examples/jsm/tsl/display/PixelationPassNode.js @@ -1,5 +1,5 @@ import { NearestFilter, Vector4, TempNode, NodeUpdateType, PassNode } from 'three/webgpu'; -import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec3, clamp, floor, dot, smoothstep, If, sign, step, mrt, output, normalView, property } from 'three/tsl'; +import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec3, clamp, floor, dot, smoothstep, If, sign, step, mrt, output, normalView, property, vec4 } from 'three/tsl'; /** * A inner node definition that implements the actual pixelation TSL code. @@ -202,7 +202,7 @@ class PixelationNode extends TempNode { const strength = dei.greaterThan( 0 ).select( float( 1.0 ).sub( dei.mul( this.depthEdgeStrength ) ), nei.mul( this.normalEdgeStrength ).add( 1 ) ); - return texel.mul( strength ); + return vec4( texel.mul( strength ).rgb, texel.a ); } ); diff --git a/examples/webgpu_mesh_batch.html b/examples/webgpu_mesh_batch.html index f9d77872ae262d..d2102c331ba900 100644 --- a/examples/webgpu_mesh_batch.html +++ b/examples/webgpu_mesh_batch.html @@ -38,7 +38,7 @@ import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; import { radixSort } from 'three/addons/utils/SortUtils.js'; - import { normalView, directionToColor, diffuseColor } from 'three/tsl'; + import { normalView, directionToColor, diffuseColor, vec4 } from 'three/tsl'; let camera, scene, renderer; let controls; @@ -126,7 +126,10 @@ if ( ! material ) { material = new THREE.MeshBasicNodeMaterial(); - material.outputNode = diffuseColor.mul( directionToColor( normalView ).y.add( 0.5 ) ); + material.outputNode = vec4( + diffuseColor.mul( directionToColor( normalView ).y.add( 0.5 ) ).rgb, + diffuseColor.a, + ); } diff --git a/examples/webgpu_postprocessing_motion_blur.html b/examples/webgpu_postprocessing_motion_blur.html index f71802be939211..a3f84301993edc 100644 --- a/examples/webgpu_postprocessing_motion_blur.html +++ b/examples/webgpu_postprocessing_motion_blur.html @@ -32,7 +32,7 @@