Skip to content

TSL Transpiler: negateBefore #31567

@DennisSmolek

Description

@DennisSmolek

Description

I'm sure with all the changes with TSL there may have been that method but it's no longer there.
When porting demos over I copied over a version of IQuilezles noised and didnt catch it until runtime that the conversion used the method.

// float k7 = - a + b + c - d + e - f - g + h;
    const k7Wrong = a.negateBefore().add(b).add(c.sub(d)).add(e.sub(f).sub(g)).add(h); // wrong
    const k7 = a.negate().add(b).add(c.sub(d)).add(e.sub(f).sub(g)).add(h); // correct

Reproduction steps

Go here: https://threejs.org/examples/?q=tsl#webgpu_tsl_transpiler

Put this: float k7 = - a + b + c - d + e - f - g + h;

Version

179

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions