* Enable point sprite mode only for first texture unit. May prevent ATI driver crashes

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7875 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 14 years ago
parent 1e8dea8eba
commit d48b06c951
  1. 25
      engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java

@ -531,13 +531,28 @@ public class LwjglRenderer implements Renderer {
} }
if (state.isPointSprite() && !context.pointSprite) { if (state.isPointSprite() && !context.pointSprite) {
glEnable(GL_POINT_SPRITE); // Only enable/disable sprite
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE); if (context.boundTextures[0] != null){
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE); if (context.boundTextureUnit != 0){
glActiveTexture(GL_TEXTURE0);
context.boundTextureUnit = 0;
}
glEnable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_TRUE);
glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
}
context.pointSprite = true; context.pointSprite = true;
} else if (!state.isPointSprite() && context.pointSprite) { } else if (!state.isPointSprite() && context.pointSprite) {
glDisable(GL_POINT_SPRITE); if (context.boundTextures[0] != null){
context.pointSprite = false; if (context.boundTextureUnit != 0){
glActiveTexture(GL_TEXTURE0);
context.boundTextureUnit = 0;
}
glDisable(GL_POINT_SPRITE);
glTexEnvi(GL_POINT_SPRITE, GL_COORD_REPLACE, GL_FALSE);
glDisable(GL_VERTEX_PROGRAM_POINT_SIZE);
context.pointSprite = false;
}
} }
if (state.isPolyOffset()) { if (state.isPolyOffset()) {

Loading…
Cancel
Save