简体   繁体   中英

Which combination for uvec2 fragment shader output

I've been trying to output into GL_COLOR_ATTACHMENT1 unsigned values R and G. The texture is set with these format / internal format / type :

GL_RG / GL_RG8UI / GL_UNSIGNED_INT

I also tried with GL_UNSIGNED_BYTE , it results the same issue: incomplete framebuffer.

I output in fragment shader that way:

layout (location = 0) vec3 nofrag;
layout (location = 1) uvec2 matfrag;

Any idea? I thought GL_UNSIGNED_INT_8_8_8_8 would have been better: well it's definitely not…

Solved! Thank you, glYoda! Here's the solution:

GL_RG_INTEGER / GL_RG8UI / GL_UNSIGNED_BYTE

I think GL_UNSIGNED_INT is nice too, but since GL* 8 *UINT, BYTE is far away better.

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