Key color solution in OpenGL

xiaoxiao2021-03-06  39

Setting key colors in OpenGL. But in many places in OpenGL need key color treatment. For example, rendering the UI in the game. So I will put two ways here to solve this problem.

1. Set Alpha's Alpha to 0, and other places are set to 1. Use Alpha Blend.

2. Better method. Or set the alpha of the key color portion to 0 or a decimal. Use Alpha Test. For example, you set alpha into 0.1. You will write this: GLALPHAFUNC (GL_GReater, 0.2); Glenable (GL_ALPHA_TEST);

Don't tell me that you don't convert RGB data to RGBA data. The pseudo code is as follows: for (int i = 0, j = 0; i

转载请注明原文地址:https://www.9cbs.com/read-52428.html

New Post(0)