Image Component Library (ICL)
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
icl::geom::ShaderUtil Class Reference

#include <ShaderUtil.h>

Inheritance diagram for icl::geom::ShaderUtil:
icl::utils::Uncopyable

Public Types

enum  ShaderType {
  SHADOW, SHADOW_TEXTURE, NO_SHADOW, NO_SHADOW_TEXTURE,
  COUNT
}
 Enum representing the different shader types. More...
 

Public Member Functions

 ShaderUtil (const Camera *camera, icl::qt::GLFragmentShader **shaders, const std::vector< Mat > *project2shadow, float shadowBias)
 
 ShaderUtil ()
 
void activateShader (Primitive::Type type, bool withShadow)
 
void deactivateShaders ()
 
const CameragetCurrentCamera () const
 

Static Public Member Functions

static void recompilePerPixelShader (icl::qt::GLFragmentShader **shaders, const icl::utils::SmartPtr< SceneLight > *lights, int numShadowLights)
 

Private Attributes

const Cameram_camera
 
icl::qt::GLFragmentShader ** m_shaders
 
icl::qt::GLFragmentShaderactiveShader
 
const std::vector< Mat > * project2shadow
 
float m_shadowBias
 
bool renderingShadow
 

Additional Inherited Members

- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 

Detailed Description

The ShaderUtil is an easy to use wrapper for activating the correct shader for the primitive that is to be rendered.

Member Enumeration Documentation

◆ ShaderType

Enum representing the different shader types.

Enumerator
SHADOW 
SHADOW_TEXTURE 
NO_SHADOW 
NO_SHADOW_TEXTURE 
COUNT 

Constructor & Destructor Documentation

◆ ShaderUtil() [1/2]

icl::geom::ShaderUtil::ShaderUtil ( const Camera camera,
icl::qt::GLFragmentShader **  shaders,
const std::vector< Mat > *  project2shadow,
float  shadowBias 
)

◆ ShaderUtil() [2/2]

icl::geom::ShaderUtil::ShaderUtil ( )

This constructor can be used, when the ShaderUtil is not supposed to activate any shaders. The main use for this is to make it transparent to the render function of an object if it is to be rendered into the shadowbuffer or not.

Member Function Documentation

◆ activateShader()

void icl::geom::ShaderUtil::activateShader ( Primitive::Type  type,
bool  withShadow 
)

◆ deactivateShaders()

void icl::geom::ShaderUtil::deactivateShaders ( )

◆ getCurrentCamera()

const Camera& icl::geom::ShaderUtil::getCurrentCamera ( ) const

◆ recompilePerPixelShader()

static void icl::geom::ShaderUtil::recompilePerPixelShader ( icl::qt::GLFragmentShader **  shaders,
const icl::utils::SmartPtr< SceneLight > *  lights,
int  numShadowLights 
)
static

Member Data Documentation

◆ activeShader

icl::qt::GLFragmentShader* icl::geom::ShaderUtil::activeShader
private

◆ m_camera

const Camera* icl::geom::ShaderUtil::m_camera
private

◆ m_shaders

icl::qt::GLFragmentShader** icl::geom::ShaderUtil::m_shaders
private

◆ m_shadowBias

float icl::geom::ShaderUtil::m_shadowBias
private

◆ project2shadow

const std::vector<Mat>* icl::geom::ShaderUtil::project2shadow
private

◆ renderingShadow

bool icl::geom::ShaderUtil::renderingShadow
private

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