actarian / vscode-glsl-canvas

Live WebGL preview of GLSL shaders
MIT License
335 stars 25 forks source link

Texture samples array does not work #65

Closed edap closed 3 years ago

edap commented 3 years ago

In my workspace settings I have:

{
    "glsl-canvas.textures": {
        "0": "./textures/0.png",
        "1": "./textures/1.png",
        "2": "./textures/2.png",
    }
}

In my shader I use this uniforms:

uniform sampler2D u_tex0;
uniform sampler2D u_tex1;
uniform sampler2D u_tex2;

All the 3 samplers show the same image, "./textures/0.png". It looks like slot 1 and slot 2 are not read, or their content is overwritten by the first texture in glsl-canvas.textures object.

actarian commented 3 years ago

Hi @edap correct naming for textures is uniform sampler2D u_texture_0; uniform sampler2D u_texture_1; uniform sampler2D u_texture_2;

edap commented 3 years ago

I see, thanks.