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:
- Bindtextureimage: cleaning GL error: 0x502 during Android opengles2.0 hard decoding
- Common problems of shadow map in OpenGL
- OpenGL Usage Summary (including problems encountered and solutions)
- Some problems in OpenGL
- Common problems and basic concept knowledge of OpenGL
- Error: no override found for ‘vtkRayCastImageDisplayHelper’.
- Building OpenGL environment
- Gles2.0 Chinese API glgeterror
- An example of drawing rotating cube with OpenGL
- Drawing a cube with OpenGL
- VTK notes — texture mapping
- Resolve Audio: failed to create voice ` goldfish_ Audio ‘error
- How to save big data in Oracle to CLOB
- Solution to the failure of creating bitmap with multithreaded OpenGL
- OpenGL learning notes and other learning thinking
- curl.perform() pycurl.error: (23, ‘Failed writing body (0 != 59)’)
- OpenGL cube texture map
- On the configuration of OpenGL Red Book eighth edition environment in vs2013
- Create a D3D11 application process
- VTK: VTK error problem set