OpenGL 怎么关闭glsl里的某个纹理 how to disable texture?

1 篇文章 0 订阅
1 篇文章 0 订阅

you can't use glEnable glDisable TEXTURE_2D to force a glsl shader to use or no texture mapping

glEnable glDisable has no effect if the state you want to enable or disable is  concerned by the vertex or fragment stage(like textures, lights, fog ...)
however some other state like DEPTH_TEST is not concerned by the fragment vertex stage (see the gl specs for more informations)
there's many solution for this:
write another shader for geometri that doesn't use textures
or use a uniform variable as a boolean(int 0 or 1) to tell the shader

if it's using or not textures


原来那个人提的问题是:

Hello people, I'm using shaders(glsl) in my opengl program (C++) and I'm using it for texture mapping. My question is how can I disable the shaders for some geometries and apply shaders to some other, like glDisable(GL_TEXTURE_2D) in opengl, I tried it but it doesn't work. Many tnx in advance


https://www.gamedev.net/forums/topic/452364-how-to-disable-texture-in-glsl/

其他链接:

https://gamedev.stackexchange.com/questions/62457/why-would-one-bind-several-textures-to-the-same-opengl-texture-unit

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值