public class AlphaTestCameraGroupStrategy extends Object implements com.badlogic.gdx.graphics.g3d.decals.GroupStrategy, com.badlogic.gdx.utils.Disposable
Note:
This is almost exactly the same as CameraGroupStrategy except that
this version requires shader support and it's shader has been slightly modified to perform a simple alpha-test
in the fragment shader.
Minimalistic grouping strategy that splits decals into opaque and transparent ones enabling and disabling blending as needed.
Opaque decals are rendered first (decal color is ignored in opacity check).
Use this strategy only if the vast majority of your decals are opaque and the few transparent ones are unlikely to overlap.
Can produce invisible artifacts when transparent decals overlap each other.
Needs to be explicitely disposed as it might allocate a ShaderProgram when GLSL 2.0 is used.
States (* = any, EV = entry value - same as value before flush):
| expects | exits on | |
| glDepthMask | true | EV |
| GL_DEPTH_TEST | enabled | EV |
| glDepthFunc | GL_LESS | GL_LEQUAL | EV |
| GL_BLEND | disabled | EV | disabled |
| glBlendFunc | * | * |
| GL_TEXTURE_2D | * | disabled |
| Constructor and Description |
|---|
AlphaTestCameraGroupStrategy(com.badlogic.gdx.graphics.Camera camera) |
AlphaTestCameraGroupStrategy(com.badlogic.gdx.graphics.Camera camera,
Comparator<com.badlogic.gdx.graphics.g3d.decals.Decal> sorter) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterGroup(int group) |
void |
afterGroups() |
void |
beforeGroup(int group,
com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g3d.decals.Decal> contents) |
void |
beforeGroups() |
int |
decideGroup(com.badlogic.gdx.graphics.g3d.decals.Decal decal) |
void |
dispose() |
com.badlogic.gdx.graphics.Camera |
getCamera() |
com.badlogic.gdx.graphics.glutils.ShaderProgram |
getGroupShader(int group) |
void |
setCamera(com.badlogic.gdx.graphics.Camera camera) |
public AlphaTestCameraGroupStrategy(com.badlogic.gdx.graphics.Camera camera)
public AlphaTestCameraGroupStrategy(com.badlogic.gdx.graphics.Camera camera,
Comparator<com.badlogic.gdx.graphics.g3d.decals.Decal> sorter)
public void setCamera(com.badlogic.gdx.graphics.Camera camera)
public com.badlogic.gdx.graphics.Camera getCamera()
public int decideGroup(com.badlogic.gdx.graphics.g3d.decals.Decal decal)
decideGroup in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic void beforeGroup(int group,
com.badlogic.gdx.utils.Array<com.badlogic.gdx.graphics.g3d.decals.Decal> contents)
beforeGroup in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic void afterGroup(int group)
afterGroup in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic void beforeGroups()
beforeGroups in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic void afterGroups()
afterGroups in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic com.badlogic.gdx.graphics.glutils.ShaderProgram getGroupShader(int group)
getGroupShader in interface com.badlogic.gdx.graphics.g3d.decals.GroupStrategypublic void dispose()
dispose in interface com.badlogic.gdx.utils.DisposableCopyright © 2022. All rights reserved.