Skip to content
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

es 3.0 webgl 2 support #103

Open
gillesboisson opened this issue Feb 11, 2018 · 1 comment
Open

es 3.0 webgl 2 support #103

gillesboisson opened this issue Feb 11, 2018 · 1 comment

Comments

@gillesboisson
Copy link

Hi,
Does glsify support webgl 2 ?
For example it rename the function texture (texture2D in webgl 1) when I use it in a module.

cheers

@NoxWings
Copy link

NoxWings commented Aug 5, 2019

I'm experiencing a similar problem.
I have made a module that uses the texture functions and glslify is renaming the function name to texture_0


I'm using glslify through rollup-plugin-glslify.

Today I've tried extracting this function to another file

float textureDepth(sampler2D depth, vec2 coords) {
    if (coords.x < 0.001 ||
        coords.y < 0.001 ||
        coords.x > 1.0 - 0.001 ||
        coords.y > 1.0 - 0.001) {
        return 1.0;
    }
    return texture(depth, coords).r;
}

#pragma glslify: export(textureDepth)

this function works completely fine if I just place it on the main file but upon extracting it to a new file and them importing it using something like...

#pragma glslify: textureDepth = require("../chunks/textureDepth.glsl")

for some reason the function texture is being renamed into texture_0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants