Module three_d::core[][src]

Modular abstractions of common graphics concepts such as GPU shader program, buffer (vertex buffer, uniform buffer, element buffer), texture (2D texture, cube texture, ..) and render target. They are higher level than context but lower level than other features.

Structs

BlendParameters

Defines which type of blending to use for a render call. Blending allows combining each color channel of a render call with the color already in the color channels of the render target. This is usually used to simulate transparency.

ClearState

Defines which channels (red, green, blue, alpha and depth) to clear when starting to write to a render target or the screen and which values they are set to (the values must be between 0 and 1).

ColorTargetTexture2D

A 2D texture that can be rendered into using a RenderTarget.

ColorTargetTexture2DArray

A 2D texture array that can be rendered into using a RenderTargetArray.

DepthTargetTexture2D

A 2D texture that can be rendered into using a RenderTarget.

DepthTargetTexture2DArray

A 2D texture array that can be rendered into using a RenderTargetArray.

ElementBuffer

A buffer containing indices for rendering, see for example draw_elements. Also known as an index buffer.

Program

A shader program consisting of a programmable vertex shader followed by a programmable fragment shader. Functionality includes transferring per vertex data to the vertex shader (see the use_attribute functionality) and transferring uniform data to both shader stages (see the use_uniform and use_texture functionality) and execute the shader program (see the draw functionality).

RenderStates

A set of render specific states that has to be specified at each render call.

RenderTarget

Use a render target to render into a texture (color, depth or both). Can be created each time it is needed.

RenderTargetArray

Same as RenderTarget except that the render target contains an array of color textures and depth textures.

Screen

The screen render target which is essential to get something on the screen (see the write function).

Texture2D

A 2D texture, basically an image that is transferred to the GPU. For a texture that can be rendered into, see ColorTargetTexture2D.

TextureCubeMap

A texture that covers all 6 sides of a cube.

UniformBuffer

A buffer for transferring a set of uniform variables to the shader program (see also use_uniform_block).

VertexBuffer

A buffer containing per vertex data, for example positions, normals, uv coordinates or colors (see also use_attribute, use_attribute_vec2, etc.).

WriteMask

Defines which channels (red, green, blue, alpha and depth) to write to in a render call.

Enums

BlendEquationType

How the source and target color or alpha value are combined in blend parameters.

BlendMultiplierType

Value multiplied with the source or target color or alpha value in blend parameters.

CullType

Defines whether the triangles that are backfacing, frontfacing or both should be skipped in a render call.

DepthFormat

Type of formats for depth render targets (DepthTargetTexture2D and DepthTargetTexture2DArray).

DepthTestType

Defines the depth test in a render call. The depth test determines whether or not a fragment from the current render call should be discarded when comparing its depth with the depth of the current fragment.

Error

Error message from the core module.

Traits

Texture

A texture that can be sampled in a fragment shader (see use_texture).