public interface GroupStrategy
This class provides hooks which are invoked by
DecalBatch to evaluate the group a sprite falls into, as well as to
adjust settings before and after rendering a group.
A group is identified by an integer. The
beforeGroup() method provides the strategy with a list
of all the decals, which are contained in the group itself, and will be rendered before the associated call to
A call to
beforeGroup() is always followed by a call to
Groups are always invoked based on their ascending int values. Group -10 will be rendered before group -5, group -5 before group 0, group 0 before group 6 and so on.
The call order for a single flush is always
beforeGroups(), beforeGroup1(), afterGroup1(), ... beforeGroupN(),
The contents of the
beforeGroup() call can be modified at will to realize view frustum culling, material & depth
sorting, ... all based on the requirements of the current group. The batch itself does not change OpenGL settings except for
whichever changes are entailed
DecalMaterial.set(). If the group requires a special shader, blending,
getGroupShader(int) should return it so that DecalBatch can apply it while rendering the group.
|Modifier and Type||Method and Description|
Invoked directly after rendering of a group has completed
Invoked after having rendered all groups
Invoked directly before rendering the contents of a group
Invoked before rendering any group
Assigns a group to a decal
Returns the shader to be used for the group.
ShaderProgram getGroupShader(int group)
group- the group
int decideGroup(Decal decal)
decal- Decal to assign group to
group- Group that will be rendered
contents- Array of entries of arrays containing all the decals in the group
void afterGroup(int group)
group- Group which completed rendering