(m_viewDims.y - m_position.y) / m_viewDims.y) PVRTVec2 topRightPos = PVRTVec2((m_viewDims.x - (m_position.x + m_drawDims.x)) / m_viewDims.x, ((m_viewDims.y - (m_position.y - m_drawDims.y)) / m_viewDims.y)) PVRTVec2 bottomLeftPos = PVRTVec2((m_viewDims.x - m_position.x) / m_viewDims.x, Performance: could pull this out and only recalculate when moved GlBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) Here's the snippet for rendering in ES2.0 void Sprite::Render(GLuint shaderProgram, UniformHandles* uniforms, AttributeHandles* attributes) Is there perhaps a call I should be making between primitive renders to clean out the shaders? Any suggestions would be great - I've browsed dozens of good forums and Stack Exchange. I'll attempt to provide relevant code snippets below. Interestingly, I'm building this engine to support both ES1.1 and ES2.0, and the same code works great in ES1.1 for multiple sprites. I have to admit, I'm fairly new to shaders. I think it has to do with something in my shader not getting cleared out properly before it is used again. If I reverse the two sprites render orders, the sprite that was rendered second previously (and had corrupt texture mapping) is now correct, and the other sprite is now corrupt. When I add a second sprite to the world, its texture does not get mapped properly. The first one always works great: it is positioned and sized properly in screen coords, and its texture is mapped properly. I'm having a tremendous time getting the second (or additional) sprites in my game engine to render properly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |