Skip to content

Commit a91f2d4

Browse files
committed
Don’t use property() for unassigned variables
1 parent 43d0f73 commit a91f2d4

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

examples/jsm/tsl/display/DenoiseNode.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { DataTexture, RepeatWrapping, Vector2, Vector3, TempNode } from 'three/webgpu';
2-
import { texture, getNormalFromDepth, getViewPosition, convertToTexture, nodeObject, Fn, float, NodeUpdateType, uv, uniform, Loop, luminance, vec2, vec3, vec4, uniformArray, int, dot, max, pow, abs, If, textureSize, sin, cos, mat2, PI, property } from 'three/tsl';
2+
import { texture, getNormalFromDepth, getViewPosition, convertToTexture, nodeObject, Fn, float, NodeUpdateType, uv, uniform, Loop, luminance, vec2, vec3, vec4, uniformArray, int, dot, max, pow, abs, If, textureSize, sin, cos, mat2, PI } from 'three/tsl';
33
import { SimplexNoise } from '../../math/SimplexNoise.js';
44

55
/**
@@ -187,7 +187,7 @@ class DenoiseNode extends TempNode {
187187
const viewNormal = sampleNormal( uvNode ).toVar();
188188

189189
const texel = sampleTexture( uvNode ).toVar();
190-
const result = property( 'vec4' );
190+
const result = vec4().toVar();
191191

192192
If( depth.greaterThanEqual( 1.0 ).or( dot( viewNormal, viewNormal ).equal( 0.0 ) ), () => {
193193

examples/jsm/tsl/display/DepthOfFieldNode.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { TempNode, NodeMaterial, NodeUpdateType, RenderTarget, Vector2, HalfFloatType, RedFormat, QuadMesh, RendererUtils } from 'three/webgpu';
2-
import { convertToTexture, nodeObject, Fn, uniform, smoothstep, step, texture, max, uniformArray, outputStruct, property, vec4, vec3, uv, Loop, min, mix } from 'three/tsl';
2+
import { convertToTexture, nodeObject, Fn, uniform, smoothstep, step, texture, max, uniformArray, outputStruct, float, vec4, vec3, uv, Loop, min, mix } from 'three/tsl';
33
import { gaussianBlur } from './GaussianBlurNode.js';
44

55
const _quadMesh = /*@__PURE__*/ new QuadMesh();
@@ -355,8 +355,8 @@ class DepthOfFieldNode extends TempNode {
355355

356356
// CoC, near and far fields
357357

358-
const nearField = property( 'float' );
359-
const farField = property( 'float' );
358+
const nearField = float().toVar();
359+
const farField = float().toVar();
360360

361361
const outputNode = outputStruct( nearField, farField );
362362

examples/jsm/tsl/display/PixelationPassNode.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NearestFilter, Vector4, TempNode, NodeUpdateType, PassNode } from 'three/webgpu';
2-
import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec3, clamp, floor, dot, smoothstep, If, sign, step, mrt, output, normalView, property } from 'three/tsl';
2+
import { nodeObject, Fn, float, uv, uniform, convertToTexture, vec2, vec3, clamp, floor, dot, smoothstep, If, sign, step, mrt, output, normalView } from 'three/tsl';
33

44
/**
55
* A inner node definition that implements the actual pixelation TSL code.
@@ -127,7 +127,7 @@ class PixelationNode extends TempNode {
127127

128128
const depthEdgeIndicator = ( depth ) => {
129129

130-
const diff = property( 'float', 'diff' );
130+
const diff = float().toVar( 'diff' );
131131
diff.addAssign( clamp( sampleDepth( 1, 0 ).sub( depth ) ) );
132132
diff.addAssign( clamp( sampleDepth( - 1, 0 ).sub( depth ) ) );
133133
diff.addAssign( clamp( sampleDepth( 0, 1 ).sub( depth ) ) );
@@ -158,7 +158,7 @@ class PixelationNode extends TempNode {
158158

159159
const normalEdgeIndicator = ( depth, normal ) => {
160160

161-
const indicator = property( 'float', 'indicator' );
161+
const indicator = float().toVar( 'indicator' );
162162

163163
indicator.addAssign( neighborNormalEdgeIndicator( 0, - 1, depth, normal ) );
164164
indicator.addAssign( neighborNormalEdgeIndicator( 0, 1, depth, normal ) );
@@ -173,8 +173,8 @@ class PixelationNode extends TempNode {
173173

174174
const texel = sampleTexture();
175175

176-
const depth = property( 'float', 'depth' );
177-
const normal = property( 'vec3', 'normal' );
176+
const depth = float().toVar( 'depth' );
177+
const normal = vec3().toVar( 'normal' );
178178

179179
If( this.depthEdgeStrength.greaterThan( 0.0 ).or( this.normalEdgeStrength.greaterThan( 0.0 ) ), () => {
180180

@@ -183,15 +183,15 @@ class PixelationNode extends TempNode {
183183

184184
} );
185185

186-
const dei = property( 'float', 'dei' );
186+
const dei = float().toVar( 'dei' );
187187

188188
If( this.depthEdgeStrength.greaterThan( 0.0 ), () => {
189189

190190
dei.assign( depthEdgeIndicator( depth ) );
191191

192192
} );
193193

194-
const nei = property( 'float', 'nei' );
194+
const nei = float().toVar( 'nei' );
195195

196196
If( this.normalEdgeStrength.greaterThan( 0.0 ), () => {
197197

0 commit comments

Comments
 (0)