Commits

André Schnabel committed 43bbb3b

added alpha test func

  • Participants
  • Parent commits 9743274

Comments (0)

Files changed (2)

src/com/andreschnabel/weltraumsoldat3d/framework/BasicScreen.java

 		
 		gl10.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);		
 		gl10.glBlendFunc(GL10.GL_ONE, GL10.GL_SRC_ALPHA); /*GL10.GL_ONE_MINUS_SRC_ALPHA*/
+		
+		gl10.glAlphaFunc(GL10.GL_GREATER, 0.5f);
+		gl10.glDisable(GL10.GL_ALPHA_TEST);
 	}
 	
 	public final void renderScene(final float delta) {

src/com/andreschnabel/weltraumsoldat3d/rendering/sprite/SpriteManager.java

 
 import static com.andreschnabel.weltraumsoldat3d.Constants.*;
 import static com.badlogic.gdx.graphics.GL10.GL_BLEND;
+import static com.badlogic.gdx.graphics.GL10.GL_ALPHA_TEST;
 
 import java.io.BufferedReader;
 import java.io.BufferedWriter;
 	public boolean draw(final GL10 gl10) {
 		boolean dirty = false;
 		gl10.glEnable(GL_BLEND);
+		gl10.glEnable(GL_ALPHA_TEST);
 		float yaw = Utils.getYawOfCam(cam);
 		
 		// sort from far to near for blending
 				s.render(gl10, yaw);
 		}
 		
+		gl10.glDisable(GL_ALPHA_TEST);
 		gl10.glDisable(GL_BLEND);
 		
 		cleanupMarked();