Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::DirectionalLightUniforms Class Reference

The DirectionalLightUniforms class is responsible for managing the uniforms which describe a directional light that can be used by bgfx shaders. More...

#include <vclib/bgfx/drawable/uniforms/directional_light_uniforms.h>

Static Public Member Functions

static void bind ()
 
template<typename S >
static void setLight (const vcl::DirectionalLight< S > &light)
 setLight
 

Static Private Attributes

static std::array< float, 4 > sCol = {1.0, 1.0, 1.0, 1.0}
 
static std::array< float, 4 > sDir = {0.0, 0.0, 1.0, 0.0}
 
static Uniform sLightColorUniform
 
static Uniform sLightDirUniform
 

Detailed Description

The DirectionalLightUniforms class is responsible for managing the uniforms which describe a directional light that can be used by bgfx shaders.

It provides a static interface to set the uniform data based on the current directional light data and to bind the uniforms to the shader programs.

The uniforms of this class can be used by including the shader header <vclib/bgfx/drawable/uniforms/directional_light_uniforms.sh> in the shader.

The uniforms are:

  • u_lightDirPack (vec4): the light direction packed in a vec4
  • u_lightColorPack (vec4): the light color packed in a vec4

The shader header makes available the following uniforms:

  • u_lightDir (vec3): the light direction
  • u_lightColor (vec3): the light color

Member Function Documentation

◆ setLight()

template<typename S >
static void vcl::DirectionalLightUniforms::setLight ( const vcl::DirectionalLight< S > &  light)
inlinestatic

setLight

Parameters
light

The documentation for this class was generated from the following file: