ios - Texture no longer renders after UV change -
I am going to write texture Atlas Manager, but I have run into a problem. When I modified my original UV coordinate, does my program no longer render anything ?? This is my Draw Code:
- (zero) Droverframe {[(EAGLView *) self.view setFramebuffer]; // GLfloat aspectRatio = self.view.bounds.size.height / self.view.bounds.size.width; Float m [16] = {2 / self. Overview. Boundsize.with, 0, 0, 0, 0, 2 / Self. Observation. Bounds Skies Height, 0, 0, 0, 0, -1, 0, 0, 0, 0, 1}; CGSize imageSize = CGSizeMake (512, 512); CGRT drones = CGRactack (0, 0, 106, 126); GLfloat x = (1 / imageSize.width) * drawBounds.size.width; GLfloat y = (1 / imageSize.height) * drawBounds.size.height; Static forceps GLfloat corners [] = {-53.0f, -63.0f, 53.0f, -63.0f, -53.0f, 63.0f, 53.0f, 63.0f,}; GLfloat texCoords [] = {0.0, 0.0, x, 0.0, 0.0, y, x, y}; Glucaller (0.5 F, 0.5 F, 0.5 F, 1.0 F); GlClear (GL_COLOR_BUFFER_BIT); GlUseProgram (program); [[Texture Library Shade Breakout Library] BindTechnctions: @ "Bounce" slot: GL_Ectureware 0]; GlUniform1f (Uniform [UNIFORM_TEXTURE], 0); GlUniformMatrix4fv (UNIFORM_MVP_MATRIX, 1, GL_FALSE, m); GlVertexAttribPointer (ATTRIB_VERTEX, 2, GL_FLOAT, 0, 0, meridian); GlEnableVertexAttribArray (ATTRIB_VERTEX); GlVertexAttribPointer (ATTRIB_TEXTURE_POSITION, 2, GL_FLOAT, 0, 0, Texas); GlEnableVertexAttribArray (ATTRIB_TEXTURE_POSITION); GlDrawArrays (GL_TRIANGLE_STRIP, 0, 4); [(EAGLView *) self.view presentFramebuffer]; } However, it works just as well:
GLfloat texCoords [] = {0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 1.0}; Help?
Just an estimate, but OpenGL understands (0, 0) having the lower left corner of an image for. Is it possible that your graphic is on the upper left, the area you are displaying is actually from the transparent part of the texture?
If so, you can adjust your textures coordinates or adjust the texture matrix stack so that (0, 0) is on the upper left side.
Comments
Post a Comment