Skip to content

Support other math functions #202

@rjamesnw

Description

@rjamesnw

I noticed you don't have support for other math functions, such as trunc(). I tried to put the function call in anyhow, and it seems like the shader script outputs it as is, but it won't compile for some reason (thinks it's a missing identifier instead of a call).

float user_gx=(trunc((user_x/user_pixelSize))+user_xArraySelector);
float user_gridXDiff=(user_gx-user_gridX);
float user_gridDirX=sign(user_gridXDiff);
if ((user_outIndex==10.0)) {
kernelResult = user_gridDirX;return;
}

float user_gy=(trunc((user_y/user_pixelSize))+user_yArraySelector);
float user_gridYDiff=(user_gy-user_gridY);
float user_gridDirY=sign(user_gridYDiff);
if ((user_outIndex==11.0)) {
kernelResult = user_gridDirY;return;
}

Shader compilation errors
(283, 16): Undeclared identifier 'trunc'

I've used that function in other shaders in webgl and it works just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions