Skip to content

TSL: Unable to use "bool" uniform #31479

@gkjohnson

Description

@gkjohnson

Description

When using a "bool" uniform with TSL the following error is thrown:

Image

Reproduction steps

  1. Use a "bool" uniform type
  2. See error

Code

const material = new THREE.MeshBasicNodeMaterial();
material.colorNode = wgslFn( `
  fn getColorValue( boolUniform: f32 ) -> vec4f {

    return vec4f( f32( boolUniform ), 0, 0, 1 );

  }
` )( {
  boolUniform: uniform( true ),
} );

Live example

https://jsfiddle.net/9ndtvok3/3/

Screenshots

No response

Version

dev

Device

No response

Browser

No response

OS

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    TSLThree.js Shading Language

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions