state

 

Tag: state
Parent tag:
Attributes: name (string)

Child tags:

  • ORDER (int) – materials with lower order numbers are drawn first. Default is 0. Materials with negative orders are not drawn.
  • DEPTH_TEST (bool) – enable/disable depth testing
  • DEPTH_FUNC (enum) – {LESS (default), NEVER, ALWAYS, LEQUAL, EQUAL, GEQUAL, GREATER, NOT_EQUAL}
  • DEPTH_MASK (bool) – enable/disable depth writing
  • CULL_FACE (bool) – enable/disable culling
  • CULL_TYPE (enum) – {BACK (default), FRONT, FRONT_AND_BACK}
  • COLOR_MASK (bvec4) – enable/disable writing in the individual color channels
  • BLEND (bool) – enable/disable blending
  • BLEND_SRC, BLEND_DST (enum) – {ONE (default for BLEND_SRC), ZERO (default for BLEND_DST), SRC_COLOR, ONE_MINUS_SRC_COLOR, DST_COLOR, ONE_MINUS_DST_COLOR, SRC_ALPHA, ONE_MINUS_SRC_ALPHA, DST_ALPHA, ONE_MINUS_DST_ALPHA, SRC_ALPHA_SATURATE, CONSTANT_COLOR, ONE_MINUS_CONSTANT_COLOR, CONSTANT_ALPHA, ONE_MINUS_CONSTANT_ALPHA}
  • BLEND_EQUATION (enum) – {ADD (default), SUBTRACT, REVERSE_SUBTRACT, MIN, MAX}
  • BLEND_COLOR (vec4) – the constant blend color mentioned in BLEND_SRC and BLEND_DST

This tag defines a state that can later be used in a material.

All tags, except ORDER should be clear to OpenGL developers. ORDER specifies the rendering order and can be useful to guarantee that materials with transparency are drawn last.

Example:

	
<state >
	<ORDER value="2" />
	<BLEND value="TRUE" />
	<BLEND_SRC value="SRC_ALPHA" />
	<BLEND_DST value="ONE_MINUS_SRC_ALPHA" />
</state>