简体   繁体   English

OpenGl es 2.0 GLSL fragmentColor多个纹理

[英]OpenGl es 2.0 GLSL fragmentColor multiple textures

I am rendering frame, fragment color is based on two textures, i woudl like to increment value of one of textures in one pass, i mean can i run one program on two framebuffers in one pass? 我正在渲染帧,片段颜色基于两个纹理,我想在一次传递中增加一个纹理的值,我的意思是我可以在一个传递中在两个帧缓冲区上运行一个程序吗?

like gl_fragmentColor1 and gl_fragmentColor2, but gl_fragmentColor2 is bound to second framebuffer, or can i write to texture using sampler2d in some way? 比如gl_fragmentColor1和gl_fragmentColor2,但gl_fragmentColor2绑定到第二个帧缓冲区,或者我可以用某种方式使用sampler2d写入纹理? Currently i am using color array passed as attribute to shader and calculating color changes on cpu, but approach witch texture is a lot faster, problem is that i cant decrement pixel value when i want 目前我使用颜色数组作为属性传递给着色器并计算cpu上的颜色变化,但接近女巫纹理要快得多,问题是当我想要时我不能减小像素值

OpenGL ES does not allow you to render to multiple textures at once. OpenGL ES不允许您一次渲染到多个纹理。 So no. 所以不行。 There may be an extension available, but it would probably only work for NVIDIA hardware. 可能有一个扩展可用,但它可能只适用于NVIDIA硬件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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