Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
查看 Texture2dProgram.java 中的代码,我找不到定义 sTexture 的制服的位置。其他像 aPosition 是在构造函数中定义的。
作为 opengl 的新手,看起来片段着色器使用当前纹理单元,并且纹理绑定到该纹理单元,因此 sTexture 是默认的预定义名称。
没有什么神奇的sTexture。它是一个sampler2D,它的默认值为 0(或GL_TEXTURE0),这是我们想要的。无需更改其值,因此无需获取统一地址。
sTexture
sampler2D
GL_TEXTURE0