This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.
Classes |
Public Member Functions |
Static Public Member Functions |
Protected Member Functions |
Static Protected Member Functions |
Protected Attributes |
List of all members
ofShadow Class Reference
#include <ofShadow.h>
Classes | |
class | Data |
struct | GLData |
Public Member Functions | |
ofShadow () | |
~ofShadow () | |
void | setLightType (int atype) |
void | update (const ofLight &alight) |
bool | beginDepth () |
bool | endDepth () |
bool | beginDepth (GLenum aCubeFace) |
bool | endDepth (GLenum aCubeFace) |
void | clear () |
const std::shared_ptr< ofShadow::Data > & | getData () const |
bool | getIsEnabled () |
void | setEnabled (bool ab) |
float | getNearClip () |
float | getFarClip () |
void | setNearClip (float anear) |
void | setFarClip (float afar) |
const bool | isMultiCubeFacePass () const |
const bool | isSingleOmniPass () const |
const int | getNumShadowDepthPasses () const |
void | setSingleOmniPass (bool ab) |
int | getDepthMapWidth () |
int | getDepthMapHeight () |
void | setDirectionalBounds (float aWorldWidth, float aWorldHeight) |
void | setShadowType (ofShadowType atype) |
bool | isGlCullingEnabled () |
void | setGlCullingEnabled (bool ab) |
GLenum | getFrontFaceWindingOrder () |
void | setFrontFaceWindingOrder (GLenum aw) |
GLuint | getDepthMapFboId () |
GLuint | getDepthMapTexId () |
const float & | getStrength () |
void | setStrength (float astrength) |
const float | getBias () |
void | setBias (float abias) |
const float | getNormalBias () |
void | setNormalBias (float abias) |
const float | getSampleRadius () |
void | setSampleRadius (float aradius) |
void | setAreaLightSize (float awidth, float aheight) |
void | drawFrustum () |
std::vector< glm::vec3 > | getFrustumCorners (const glm::vec3 &aup, const glm::vec3 &aright, const glm::vec3 &afwd) |
std::string | getShadowTypeAsString () |
const ofShader & | getDepthShader (ofGLProgrammableRenderer &renderer) const |
bool | setupShadowDepthShader (ofShader &ashader, const std::string aShaderMain) |
bool | setupShadowDepthShader (ofShader &ashader, int aLightType, const std::string aShaderMain) |
void | updateDepth (const ofShader &shader, ofGLProgrammableRenderer &renderer) const |
void | updateDepth (const ofShader &shader, GLenum aCubeFace, ofGLProgrammableRenderer &renderer) const |
Static Public Member Functions | |
static GLenum | getTextureTarget (int aLightType) |
static int | getNumTotalPossibleShadows (int aLightType) |
static void | setDepthMapResolution (int aLightType, int ares) |
static void | setDepthMapResolution (int aLightType, int awidth, int aheight) |
static int | getDepthMapWidth (int aLightType) |
static int | getDepthMapHeight (int aLightType) |
static GLuint | getPointTexId () |
static GLuint | getDirectionalTexId () |
static GLuint | getSpotTexId () |
static GLuint | getAreaTexId () |
static bool | hasActiveShadows () |
static std::string | getShadowTypeAsString (ofShadowType atype) |
static void | enableAllShadows () |
static void | disableAllShadows () |
static void | setAllShadowTypes (ofShadowType atype) |
static void | setAllShadowDepthResolutions (int awidth, int aheight) |
static void | setAllShadowBias (float bias) |
static void | setAllShadowNormalBias (float normalBias) |
static void | setAllShadowSampleRadius (float sampleRadius) |
static std::string | getShaderDefinesAsString () |
static bool | areShadowsSupported () |
Protected Member Functions | |
void | _drawFrustum (const glm::vec3 &aup, const glm::vec3 &aright, const glm::vec3 &afwd) |
void | _allocate () |
void | _checkSetup () |
void | _allocateFbo () |
void | _checkFbos () |
void | _updateNumShadows () |
Static Protected Member Functions | |
static void | _updateTexDataIds () |
Protected Attributes | |
std::shared_ptr< ofShadow::Data > | data |
bool | mBSinglePass = true |
glm::mat4 | mShadowProjection = glm::mat4(1.0) |
std::vector< glm::mat4 > | mLookAtMats |
std::vector< glm::mat4 > | mViewProjMats |
float | mOrthoScaleX = 1.0 |
float | mOrthoScaleY = 1.0 |
float | mDirectionalBoundsWidth = -1 |
float | mDirectionalBoundsHeight = -1 |
float | mAreaLightWidth = 100 |
float | mAreaLightHeight = 50.0 |
float | mFov = 90 |
bool | mBEnableCulling = true |
GLenum | mGlFrontFaceWindingOrder = GL_CW |
const glm::mat4 | biasMatrix |
Constructor & Destructor Documentation
◆ ofShadow()
ofShadow::ofShadow | ( | ) |
◆ ~ofShadow()
ofShadow::~ofShadow | ( | ) |
Member Function Documentation
◆ _allocate()
|
protected |
◆ _allocateFbo()
|
protected |
◆ _checkFbos()
|
protected |
◆ _checkSetup()
|
protected |
◆ _drawFrustum()
|
protected |
◆ _updateNumShadows()
|
protected |
◆ _updateTexDataIds()
|
staticprotected |
◆ areShadowsSupported()
|
static |
◆ beginDepth() [1/2]
bool ofShadow::beginDepth | ( | ) |
◆ beginDepth() [2/2]
bool ofShadow::beginDepth | ( | GLenum | aCubeFace | ) |
◆ clear()
void ofShadow::clear | ( | ) |
◆ disableAllShadows()
|
static |
◆ drawFrustum()
void ofShadow::drawFrustum | ( | ) |
◆ enableAllShadows()
|
static |
◆ endDepth() [1/2]
bool ofShadow::endDepth | ( | ) |
◆ endDepth() [2/2]
bool ofShadow::endDepth | ( | GLenum | aCubeFace | ) |
◆ getAreaTexId()
|
static |
◆ getBias()
|
inline |
◆ getData()
|
inline |
◆ getDepthMapFboId()
GLuint ofShadow::getDepthMapFboId | ( | ) |
◆ getDepthMapHeight() [1/2]
int ofShadow::getDepthMapHeight | ( | ) |
◆ getDepthMapHeight() [2/2]
|
static |
◆ getDepthMapTexId()
GLuint ofShadow::getDepthMapTexId | ( | ) |
◆ getDepthMapWidth() [1/2]
int ofShadow::getDepthMapWidth | ( | ) |
◆ getDepthMapWidth() [2/2]
|
static |
◆ getDepthShader()
const ofShader & ofShadow::getDepthShader | ( | ofGLProgrammableRenderer & | renderer | ) | const |
◆ getDirectionalTexId()
|
static |
◆ getFarClip()
|
inline |
◆ getFrontFaceWindingOrder()
|
inline |
◆ getFrustumCorners()
std::vector< glm::vec3 > ofShadow::getFrustumCorners | ( | const glm::vec3 & | aup, |
const glm::vec3 & | aright, | ||
const glm::vec3 & | afwd | ||
) |
◆ getIsEnabled()
|
inline |
◆ getNearClip()
|
inline |
◆ getNormalBias()
|
inline |
◆ getNumShadowDepthPasses()
const int ofShadow::getNumShadowDepthPasses | ( | ) | const |
◆ getNumTotalPossibleShadows()
|
static |
◆ getPointTexId()
|
static |
◆ getSampleRadius()
|
inline |
◆ getShaderDefinesAsString()
|
static |
◆ getShadowTypeAsString() [1/2]
std::string ofShadow::getShadowTypeAsString | ( | ) |
◆ getShadowTypeAsString() [2/2]
|
static |
◆ getSpotTexId()
|
static |
◆ getStrength()
|
inline |
◆ getTextureTarget()
|
static |
◆ hasActiveShadows()
|
static |
◆ isGlCullingEnabled()
|
inline |
◆ isMultiCubeFacePass()
const bool ofShadow::isMultiCubeFacePass | ( | ) | const |
◆ isSingleOmniPass()
const bool ofShadow::isSingleOmniPass | ( | ) | const |
◆ setAllShadowBias()
|
static |
◆ setAllShadowDepthResolutions()
|
static |
◆ setAllShadowNormalBias()
|
static |
◆ setAllShadowSampleRadius()
|
static |
◆ setAllShadowTypes()
|
static |
◆ setAreaLightSize()
|
inline |
◆ setBias()
|
inline |
◆ setDepthMapResolution() [1/2]
|
static |
◆ setDepthMapResolution() [2/2]
|
static |
◆ setDirectionalBounds()
void ofShadow::setDirectionalBounds | ( | float | aWorldWidth, |
float | aWorldHeight | ||
) |
◆ setEnabled()
void ofShadow::setEnabled | ( | bool | ab | ) |
◆ setFarClip()
|
inline |
◆ setFrontFaceWindingOrder()
|
inline |
◆ setGlCullingEnabled()
|
inline |
◆ setLightType()
void ofShadow::setLightType | ( | int | atype | ) |
◆ setNearClip()
|
inline |
◆ setNormalBias()
|
inline |
◆ setSampleRadius()
|
inline |
◆ setShadowType()
|
inline |
◆ setSingleOmniPass()
void ofShadow::setSingleOmniPass | ( | bool | ab | ) |
◆ setStrength()
|
inline |
◆ setupShadowDepthShader() [1/2]
bool ofShadow::setupShadowDepthShader | ( | ofShader & | ashader, |
const std::string | aShaderMain | ||
) |
◆ setupShadowDepthShader() [2/2]
bool ofShadow::setupShadowDepthShader | ( | ofShader & | ashader, |
int | aLightType, | ||
const std::string | aShaderMain | ||
) |
◆ update()
void ofShadow::update | ( | const ofLight & | alight | ) |
◆ updateDepth() [1/2]
void ofShadow::updateDepth | ( | const ofShader & | shader, |
GLenum | aCubeFace, | ||
ofGLProgrammableRenderer & | renderer | ||
) | const |
◆ updateDepth() [2/2]
void ofShadow::updateDepth | ( | const ofShader & | shader, |
ofGLProgrammableRenderer & | renderer | ||
) | const |
Member Data Documentation
◆ biasMatrix
|
protected |
Initial value:
= glm::mat4(
0.5, 0.0, 0.0, 0.0,
0.0, 0.5, 0.0, 0.0,
0.0, 0.0, 0.5, 0.0,
0.5, 0.5, 0.5, 1.0
)
◆ data
|
protected |
◆ mAreaLightHeight
|
protected |
◆ mAreaLightWidth
|
protected |
◆ mBEnableCulling
|
protected |
◆ mBSinglePass
|
protected |
◆ mDirectionalBoundsHeight
|
protected |
◆ mDirectionalBoundsWidth
|
protected |
◆ mFov
|
protected |
◆ mGlFrontFaceWindingOrder
|
protected |
◆ mLookAtMats
|
protected |
◆ mOrthoScaleX
|
protected |
◆ mOrthoScaleY
|
protected |
◆ mShadowProjection
|
protected |
◆ mViewProjMats
|
protected |
The documentation for this class was generated from the following files:
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/gl/ofShadow.h
- /Users/icq4ever/Desktop/oF0120/libs/openFrameworks/gl/ofShadow.cpp