bgfx_create_uniform

Create shader uniform parameter. Remarks: 1. Uniform names are unique. It's valid to call bgfx::createUniform multiple times with the same uniform name. The library will always return the same handle, but the handle reference count will be incremented. This means that the same number of bgfx::destroyUniform must be called to properly destroy the uniform. 2. Predefined uniforms (declared in bgfx_shader.sh): - u_viewRect vec4(x, y, width, height) - view rectangle for current view, in pixels. - u_viewTexel vec4(1.0/width, 1.0/height, undef, undef) - inverse width and height - u_view mat4 - view matrix - u_invView mat4 - inverted view matrix - u_proj mat4 - projection matrix - u_invProj mat4 - inverted projection matrix - u_viewProj mat4 - concatenated view projection matrix - u_invViewProj mat4 - concatenated inverted view projection matrix - u_model mat4[BGFX_CONFIG_MAX_BONES] - array of model matrices. - u_modelView mat4 - concatenated model view matrix, only first model matrix from array is used. - u_modelViewProj mat4 - concatenated model view projection matrix. - u_alphaRef float - alpha reference value for alpha test.

  1. bgfx_uniform_handle_t bgfx_create_uniform(const(char)* _name, bgfx_uniform_type_t _type, ushort _num)
    version(BindBgfx_Static)
    extern (C) @nogc nothrow
    bgfx_create_uniform
    (
    const(char)* _name
    ,,
    ushort _num
    )
  2. da_bgfx_create_uniform bgfx_create_uniform;

Parameters

_name const(char)*

Uniform name in shader.

_type bgfx_uniform_type_t

Type of uniform (See: bgfx::UniformType).

_num ushort

Number of elements in array.

Meta