GL_EXT_primitive_bounding_box#

Supported Hardware#

Series6, Series6XE, Series6XT

Valid APIs#

OpenGL ES 2.0

Description#

On tile-based architectures, transformed primitives are generally written out to memory before rasterization, and then read back from memory for each tile they intersect. When geometry expands during transformation due to tessellation or one-to-many geometry shaders, the external bandwidth required grows proportionally. This extension provides a way for implementations to know which tiles incoming geometry will intersect before fully transforming (and expanding) the geometry. This allows them to only store the unexpanded geometry in memory and perform expansion on-chip for each intersected tile.

New state is added to hold an axis-aligned bounding box which is assumed to contain any geometry submitted. An implementation is allowed to ignore any portions of primitives outside the bounding box, thus, if a primitive extends outside of a tile into a neighbouring tile that the bounding box didn’t intersect, the implementation is not required to render those portions. The tessellation control shader is optionally able to specify a per-patch bounding box that overrides the bounding box state for primitives generated from that patch, in order to provide tighter bounds.

The typical usage is that an application will have an object-space bounding volume for a primitive or group of primitives, either calculated at runtime or provided with the mesh by the authoring tool or content pipeline. It will transform this volume to clip space, compute an axis-aligned bounding box that contains the transformed bounding volume, and provide that at either per-patch or per-draw granularity.

Note#

OpenGL ES 3.1 and OpenGL ES Shading Language 3.10 are required.

This specification is written against the OpenGL ES 3.1 (March 17, 2014) and OpenGL ES 3.10 Shading Language (March 17, 2014) Specifications.

This extension interacts with EXT_tessellation_shader. EXT_geometry_shader trivially affects the definition of this extension.

Example#

//clip space
glPrimitiveBoundingBoxEXT(0.2f, 0.2f, 0.2f, 1.0f, //min value
                        0.3f, 0.3f, 0.3f, 1.0f); //max value
//in tessellation control shader
gl_BoundingBoxEXT[0]= vec4(0.2f, 0.2f, 0.2f, 1.0f);//min value
gl_BoundingBoxEXT[1]= vec4(0.3f, 0.3f, 0.3f, 1.0f);//max value