Visual Computing Library
All Classes Functions Variables Typedefs Enumerations Friends Modules Pages Concepts
vcl::DirectionalLightUniforms Class Reference

The DirectionalLightUniforms class manages the uniforms which describe a directional light that can be used by bgfx shaders. More...

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

Public Member Functions

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

Private Attributes

float mDir [4] = {0.0, 0.0, 1.0, 0.0}
 
float mCol [4] = {1.0, 1.0, 1.0, 1.0}
 
Uniform mLightDirUniform
 
Uniform mLightColorUniform
 

Detailed Description

The DirectionalLightUniforms class manages the uniforms which describe a directional light that can be used by bgfx shaders.

The uniforms of this class can be used by including the shader header "uniforms/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

◆ updateLight()

template<typename S >
void vcl::DirectionalLightUniforms::updateLight ( const vcl::DirectionalLight< S > &  light)
inline

updateLight

Parameters
light

Member Data Documentation

◆ mLightColorUniform

Uniform vcl::DirectionalLightUniforms::mLightColorUniform
private
Initial value:
=
Uniform("u_lightColorPack", bgfx::UniformType::Vec4)

◆ mLightDirUniform

Uniform vcl::DirectionalLightUniforms::mLightDirUniform
private
Initial value:
=
Uniform("u_lightDirPack", bgfx::UniformType::Vec4)

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