OpenGL pit record
The 3D model is loaded with OpenGL RBO texture cache
3D model loading
When working with 3D models, we often create an FBO first, and the FBO is associated with Texture and RBO. The first time we rendered it, we rendered it directly to the FBO associated texture, then went through the other texture filters and displayed it again.
There are a couple of caveats here.
Rendering must be associated with an RBO. Turn Depth Test on before rendering off-screen and always turn it off after rendering off-screen. Do another render operation, otherwise render black screen texture will appear.
OpenGL RBO
Sometimes when OpenGL uses the depth buffer, the rendering effect disappears completely, and that’s probably because the depth buffer has been turned off.
The name of the
GLDepthMask – Enables or disables write depth buffers
C specification
void glDepthMask( GLboolean flag);
parameter
flag
Specifies whether the enabled depth buffer can be written. If flag is GL_FALSE, the depth buffer write is disabled. Otherwise, it can be enabled. The initial state is to enable deep buffer writes.
describe
GLDepthMask specifies whether the enabled depth buffer can be written. If flag is GL_FALSE, the depth buffer write is disabled. Otherwise, it can be enabled. The initial state is to enable deep buffer writes.
Related Gets
GL_DEPTH_WRITEMASK glGet parameters
See also
GLColorMask, GLDepthFunc, GLDepThrangef, GLStencilMask
copyright
https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glDepthMask.xml
https://blog.csdn.net/flycatdeng
Texture cache
To create a texture cache, you must specify the size of memory for the texture.
public static int createTextureObject(int textureTarget, int width, int height) {
int[] textures = new int[1];
GLES20.glGenTextures(1, textures, 0);
GlUtil.checkGlError("glGenTextures");
int texId = textures[0];
GLES20.glBindTexture(textureTarget, texId);
GlUtil.checkGlError("glBindTexture " + texId);
GLES20.glTexParameterf(textureTarget, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameterf(textureTarget, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_LINEAR);
GLES20.glTexParameteri(textureTarget, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(textureTarget, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);
GlUtil.checkGlError("glTexParameter");
GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_RGBA, width, height, 0, GLES20.GL_RGBA, GLES20.GL_UNSIGNED_BYTE, null);
return texId;
}
Read More:
- Appium step pit summary — solution
- Step on the pit — error reported by sqoop tool.ExportTool : Error during export
- To customize the aggregate function of Flink (Step-by-Step Tutorial)
- Mybatis uses step-by-step lazy loading to cause abnormal JSON conversion. The interface 500 reports an error
- Record the problems encountered in OpenGL learning
- Ora-02292: integrity constraint (XX) violated – child record found foreign key Association, record cannot be deleted
- Vacuum box installation CentOS encountered the pit
- Pit encountered by entity class data type BigDecimal
- How to Solve Infinite scroll the pit encountered
- Using the pit in Git that rebase encountered two could not apply XXXX
- Docker builds the pit that Seata stepped on. can not connect to services-server
- Myeclipse10: one step error report solution for cracking replacejar
- OpenGL learning — problems encountered in compiling OpenGL program for the first time
- Elasticsearch recovery.RecoveryFailedException : [XXX] [0]: recovery failed on {node-1} – mining pit
- Deploy mongodb fragment combined with replica set to realize distributed storage of MySQL database files (step 10)
- OpenGL basic graphics programming – OpenGL and 3D graphics world
- Visio2007 usage record
- Pangolin installation record
- Failed: error connecting to db server: server returned error on SASL authentication step: Authentica
- Windchill: object rename record