What does sampler2D store?

后端 未结 1 738
陌清茗
陌清茗 2021-01-31 16:27

I\'ve read a texture example in OpenGL 2.1. The fragment shader looks like this:

#version 120

uniform sampler2D texture;
varying vec2 texcoord;

vo         


        
相关标签:
1条回答
  • 2021-01-31 17:32

    The sampler2D is bound to a texture unit. The glUniform call binds it to texture unit zero. The glActiveTexture() call is only needed if you are going to use multiple texture units (because GL_TEXTURE0 is the default anyway).

    0 讨论(0)
提交回复
热议问题