Keep better track of the independent alpha test related
state... This fixes a bug where if alpha test was enabled with a fall off of 0 that it could never again be disabled unless alpha falloff was first set to a non-0 value. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10938 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
		
							parent
							
								
									4fc8cb8443
								
							
						
					
					
						commit
						faf04cbb1f
					
				| @ -494,16 +494,20 @@ public class LwjglRenderer implements Renderer { | |||||||
|             context.depthFunc = state.getDepthFunc(); |             context.depthFunc = state.getDepthFunc(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (state.isAlphaTest() && context.alphaTestFallOff == 0) { |         if (state.isAlphaTest() && !context.alphaTestEnabled) { | ||||||
|             glEnable(GL_ALPHA_TEST); |             glEnable(GL_ALPHA_TEST); | ||||||
|             glAlphaFunc(convertTestFunction(context.alphaFunc), state.getAlphaFallOff()); |             glAlphaFunc(convertTestFunction(context.alphaFunc), context.alphaTestFallOff); | ||||||
|             context.alphaTestFallOff = state.getAlphaFallOff(); |             context.alphaTestEnabled = true; | ||||||
|         } else if (!state.isAlphaTest() && context.alphaTestFallOff != 0) { |         } else if (!state.isAlphaTest() && context.alphaTestEnabled) { | ||||||
|             glDisable(GL_ALPHA_TEST); |             glDisable(GL_ALPHA_TEST); | ||||||
|             context.alphaTestFallOff = 0; |             context.alphaTestEnabled = false; | ||||||
|         } |         } | ||||||
|  |         if (state.getAlphaFallOff() != context.alphaTestFallOff) { | ||||||
|  |             glAlphaFunc(convertTestFunction(context.alphaFunc), context.alphaTestFallOff);    | ||||||
|  |             context.alphaTestFallOff = state.getAlphaFallOff(); | ||||||
|  |         }          | ||||||
|         if (state.getAlphaFunc() != context.alphaFunc) { |         if (state.getAlphaFunc() != context.alphaFunc) { | ||||||
|             glAlphaFunc(convertTestFunction(state.getAlphaFunc()), state.getAlphaFallOff()); |             glAlphaFunc(convertTestFunction(state.getAlphaFunc()), context.alphaTestFallOff); | ||||||
|             context.alphaFunc = state.getAlphaFunc(); |             context.alphaFunc = state.getAlphaFunc(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user