简体   繁体   中英

pyopengl change brightness of textures

I have a program where I render two textures that are bound to some polys and add the results using this:

glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_ADD)

This works well and fast but I would like a way to change the brightness of each texture before adding them, like a gain value. This value needs to change at runtime so I can't just bake my brightness into my texture.

Also the nature of my program means I won't know how many textures I will be blending until runtime so I need a solution that will work with n textures.

Does anyone know how I would do this?

如果能够使用片段着色器,则应在片段着色器中编写代码,该代码使用应用程序传入的着色器参数更改亮度。这种方法既快速又灵活。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM