Skip to content

TSL - Loop with boolean values doesn't work?? #30954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bandinopla opened this issue Apr 18, 2025 · 1 comment
Open

TSL - Loop with boolean values doesn't work?? #30954

bandinopla opened this issue Apr 18, 2025 · 1 comment
Labels
Needs Investigation TSL Three.js Shading Language

Comments

@bandinopla
Copy link

Description

The case of using a Loop node with a boolean node doesn't seem to be working...

Reproduction steps


Code

// This should remove all green...
 const out = vec3(0,1,0 ).toVar();
    const o = Fn(()=>{ 

        const value = float( 0 ).toVar();

        Loop( value.lessThan( 10 ), () => {
            value.addAssign( 1 );  
            out.y.subAssign( 0.1 );
        });    

        return out ; 
    });  

Live example

https://jsfiddle.net/xzonyf37/

Screenshots

No response

Version

r174

Device

Desktop

Browser

Chrome

OS

Linux

@sunag
Copy link
Collaborator

sunag commented Apr 18, 2025

Try move out inside the Fn() function so that it can be declared on the correct stack.

I'll be checking for a possible incompatibility regarding this.

@sunag sunag added Needs Investigation TSL Three.js Shading Language labels Apr 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation TSL Three.js Shading Language
Projects
None yet
Development

No branches or pull requests

2 participants