7 thoughts to “WebGL着色器入门(九)添加纹理”

  1. #ifdef GL_ES
    precision mediump float;
    #endif

    uniform vec2 u_resolution;
    uniform sampler2D u_texture_1;

    void main(){
    vec2 st = gl_FragCoord.xy/u_resolution.xy;
    vec4 color = texture2D(u_texture_1,st);
    gl_FragColor = color;
    }

    想麻烦你这边讲一下这段代码的含义,我在settings.json中配置了图片,可是没有效果