LAB 180 / SHADER INTEROPERABILITY

Same effect. Two shader languages.

Keep the material graph shared while comparing a native WGSL function with its TSL equivalent, including one varying crossing the vertex–fragment boundary.

InitializingRenderer —

Preparing the native functions and comparison surface.

SHARED BRIDGE

vUvvaryingProperty('vec2', 'vUv')

NATIVE WGSL

wgslFnpositionNode + fragmentNode

NATIVE TSL

FnpositionNode + colorNode

FRAME

—draw calls —

READ THE COMPARISON

One material boundary, two implementations

The upper panel calls a native WGSL function through wgslFn. The lower panel expresses the same pixel math with TSL nodes. Both use MeshBasicNodeMaterial; only the function language changes.

attribute('uv')→vUv→fragment color