OGRE: Ogre::ShadowVolumeExtrudeProgram Class Reference - OGRE Documentation

# Ogre::ShadowVolumeExtrudeProgram Class Reference

Static class containing source for vertex programs for extruding shadow volumes. More...

`#include <OgreShadowVolumeExtrudeProgram.h>`

Inheritance diagram for Ogre::ShadowVolumeExtrudeProgram:

[legend]

List of all members.

## Public Types
enum | Programs { POINT_LIGHT = 0, POINT_LIGHT_DEBUG = 1, DIRECTIONAL_LIGHT = 2, DIRECTIONAL_LIGHT_DEBUG = 3, POINT_LIGHT_FINITE = 4, POINT_LIGHT_FINITE_DEBUG = 5, DIRECTIONAL_LIGHT_FINITE = 6, DIRECTIONAL_LIGHT_FINITE_DEBUG = 7 }
## Public Member Functions
void * | operator new (size_t sz, const char *file, int line, const char *func)
| operator new, with debug line info
void * | operator new (size_t sz)
void * | operator new (size_t sz, void *ptr)
| placement operator new
void * | operator new[] (size_t sz, const char *file, int line, const char *func)
| array operator new, with debug line info
void * | operator new[] (size_t sz)
void | operator delete (void *ptr)
void | operator delete (void *ptr, void *)
void | operator delete (void *ptr, const char *, int, const char *)
void | operator delete[] (void *ptr)
void | operator delete[] (void *ptr, const char *, int, const char *)
## Static Public Member Functions
static void | initialise (void)
| Initialise the creation of these vertex programs.
static void | shutdown (void)
| Shutdown & destroy the vertex programs.
static const String & | getPointLightExtruderArbvp1 (void)
| Get extruder program source for point lights, compatible with arbvp1.
static const String & | getPointLightExtruderVs_1_1 (void)
| Get extruder program source for point lights, compatible with vs_1_1.
static const String & | getDirectionalLightExtruderArbvp1 (void)
| Get extruder program source for directional lights, compatible with arbvp1.
static const String & | getDirectionalLightExtruderVs_1_1 (void)
| Get extruder program source for directional lights, compatible with vs_1_1.
static const String & | getPointLightExtruderArbvp1Debug (void)
| Get extruder program source for debug point lights, compatible with arbvp1.
static const String & | getPointLightExtruderVs_1_1Debug (void)
| Get extruder program source for debug point lights, compatible with vs_1_1.
static const String & | getDirectionalLightExtruderArbvp1Debug (void)
| Get extruder program source for debug directional lights, compatible with arbvp1.
static const String & | getDirectionalLightExtruderVs_1_1Debug (void)
| Get extruder program source for debug directional lights, compatible with vs_1_1.
static const String & | getProgramSource (Light::LightTypes lightType, const String syntax, bool finite, bool debug)
| General purpose method to get any of the program sources.
static const String & | getProgramName (Light::LightTypes lightType, bool finite, bool debug)
static const String & | getPointLightExtruderArbvp1Finite (void)
| Get FINITE extruder program source for point lights, compatible with arbvp1.
static const String & | getPointLightExtruderVs_1_1Finite (void)
| Get FINITE extruder program source for point lights, compatible with vs_1_1.
static const String & | getDirectionalLightExtruderArbvp1Finite (void)
| Get FINITE extruder program source for directional lights, compatible with arbvp1.
static const String & | getDirectionalLightExtruderVs_1_1Finite (void)
| Get FINITE extruder program source for directional lights, compatible with vs_1_1.
static const String & | getPointLightExtruderArbvp1FiniteDebug (void)
| Get FINITE extruder program source for debug point lights, compatible with arbvp1.
static const String & | getPointLightExtruderVs_1_1FiniteDebug (void)
| Get extruder program source for debug point lights, compatible with vs_1_1.
static const String & | getDirectionalLightExtruderArbvp1FiniteDebug (void)
| Get FINITE extruder program source for debug directional lights, compatible with arbvp1.
static const String & | getDirectionalLightExtruderVs_1_1FiniteDebug (void)
| Get FINITE extruder program source for debug directional lights, compatible with vs_1_1.
## Static Public Attributes
static const String | programNames [OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS]
## Static Private Attributes
static String | mPointArbvp1
static String | mPointVs_1_1
static String | mDirArbvp1
static String | mDirVs_1_1
static String | mPointArbvp1Debug
static String | mPointVs_1_1Debug
static String | mDirArbvp1Debug
static String | mDirVs_1_1Debug
static String | mPointArbvp1Finite
static String | mPointVs_1_1Finite
static String | mDirArbvp1Finite
static String | mDirVs_1_1Finite
static String | mPointArbvp1FiniteDebug
static String | mPointVs_1_1FiniteDebug
static String | mDirArbvp1FiniteDebug
static String | mDirVs_1_1FiniteDebug
static bool | mInitialised

## Detailed Description

Static class containing source for vertex programs for extruding shadow volumes.

Remarks:
  This exists so we don't have to be dependent on an external media files. Assembler is used so we don't have to rely on particular plugins. The assembler contents of this file were generated from the following Cg:

              // Point light shadow volume extrude
              void shadowVolumeExtrudePointLight_vp (
                  float4 position         : POSITION,
                  float  wcoord           : TEXCOORD0,

                  out float4 oPosition    : POSITION,

                  uniform float4x4 worldViewProjMatrix,
                  uniform float4   lightPos // homogeneous, object space
                  )
              {
                  // extrusion in object space
                  // vertex unmodified if w==1, extruded if w==0
                  float4 newpos =
                      (wcoord.xxxx * lightPos) +
                      float4(position.xyz - lightPos.xyz, 0);

                  oPosition = mul(worldViewProjMatrix, newpos);

              }

              // Directional light extrude
              void shadowVolumeExtrudeDirLight_vp (
                  float4 position         : POSITION,
                  float  wcoord           : TEXCOORD0,

                  out float4 oPosition    : POSITION,

                  uniform float4x4 worldViewProjMatrix,
                  uniform float4   lightPos // homogenous, object space
                  )
              {
                  // extrusion in object space
                  // vertex unmodified if w==1, extruded if w==0
                  float4 newpos =
                      (wcoord.xxxx * (position + lightPos)) - lightPos;

                  oPosition = mul(worldViewProjMatrix, newpos);

              }
              // Point light shadow volume extrude - FINITE
              void shadowVolumeExtrudePointLightFinite_vp (
                  float4 position         : POSITION,
                  float  wcoord           : TEXCOORD0,

                  out float4 oPosition    : POSITION,

                  uniform float4x4 worldViewProjMatrix,
                  uniform float4   lightPos, // homogeneous, object space
                  uniform float    extrusionDistance // how far to extrude
                  )
              {
                  // extrusion in object space
                  // vertex unmodified if w==1, extruded if w==0
                  float3 extrusionDir = position.xyz - lightPos.xyz;
                  extrusionDir = normalize(extrusionDir);

                  float4 newpos = float4(position.xyz +
                      ((1 - wcoord.x) * extrusionDistance * extrusionDir), 1);

                  oPosition = mul(worldViewProjMatrix, newpos);

              }

              // Directional light extrude - FINITE
              void shadowVolumeExtrudeDirLightFinite_vp (
                  float4 position         : POSITION,
                  float  wcoord           : TEXCOORD0,

                  out float4 oPosition    : POSITION,

                  uniform float4x4 worldViewProjMatrix,
                  uniform float4   lightPos, // homogeneous, object space
                  uniform float    extrusionDistance // how far to extrude
                  )
              {
                  // extrusion in object space
                  // vertex unmodified if w==1, extruded if w==0
                  // -ve lightPos is direction
                  float4 newpos = float4(position.xyz -
                      (wcoord.x * extrusionDistance * lightPos.xyz), 1);

                  oPosition = mul(worldViewProjMatrix, newpos);

              }

Definition at line 130 of file OgreShadowVolumeExtrudeProgram.h.

## Member Enumeration Documentation

enum Ogre::ShadowVolumeExtrudeProgram::Programs

Enumerator:

  POINT_LIGHT |
  POINT_LIGHT_DEBUG |
  DIRECTIONAL_LIGHT |
  DIRECTIONAL_LIGHT_DEBUG |
  POINT_LIGHT_FINITE |
  POINT_LIGHT_FINITE_DEBUG |
  DIRECTIONAL_LIGHT_FINITE |
  DIRECTIONAL_LIGHT_FINITE_DEBUG |

Definition at line 157 of file OgreShadowVolumeExtrudeProgram.h.

## Member Function Documentation

static void Ogre::ShadowVolumeExtrudeProgram::initialise | ( | void |  | ) | `[static]`

Initialise the creation of these vertex programs.

static void Ogre::ShadowVolumeExtrudeProgram::shutdown | ( | void |  | ) | `[static]`

Shutdown & destroy the vertex programs.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderArbvp1 | ( | void |  | ) | `[static]`

Get extruder program source for point lights, compatible with arbvp1.

Definition at line 184 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderVs_1_1 | ( | void |  | ) | `[static]`

Get extruder program source for point lights, compatible with vs_1_1.

Definition at line 186 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderArbvp1 | ( | void |  | ) | `[static]`

Get extruder program source for directional lights, compatible with arbvp1.

Definition at line 188 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderVs_1_1 | ( | void |  | ) | `[static]`

Get extruder program source for directional lights, compatible with vs_1_1.

Definition at line 190 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderArbvp1Debug | ( | void |  | ) | `[static]`

Get extruder program source for debug point lights, compatible with arbvp1.

Definition at line 193 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderVs_1_1Debug | ( | void |  | ) | `[static]`

Get extruder program source for debug point lights, compatible with vs_1_1.

Definition at line 195 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderArbvp1Debug | ( | void |  | ) | `[static]`

Get extruder program source for debug directional lights, compatible with arbvp1.

Definition at line 197 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderVs_1_1Debug | ( | void |  | ) | `[static]`

Get extruder program source for debug directional lights, compatible with vs_1_1.

Definition at line 199 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getProgramSource | ( | Light::LightTypes | lightType,
|  | const String | syntax,
|  | bool | finite,
|  | bool | debug |
| ) |  |  | `[static]`

General purpose method to get any of the program sources.

static const String& Ogre::ShadowVolumeExtrudeProgram::getProgramName | ( | Light::LightTypes | lightType,
|  | bool | finite,
|  | bool | debug |
| ) |  |  | `[static]`

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderArbvp1Finite | ( | void |  | ) | `[static]`

Get FINITE extruder program source for point lights, compatible with arbvp1.

Definition at line 211 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderVs_1_1Finite | ( | void |  | ) | `[static]`

Get FINITE extruder program source for point lights, compatible with vs_1_1.

Definition at line 213 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderArbvp1Finite | ( | void |  | ) | `[static]`

Get FINITE extruder program source for directional lights, compatible with arbvp1.

Definition at line 215 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderVs_1_1Finite | ( | void |  | ) | `[static]`

Get FINITE extruder program source for directional lights, compatible with vs_1_1.

Definition at line 217 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderArbvp1FiniteDebug | ( | void |  | ) | `[static]`

Get FINITE extruder program source for debug point lights, compatible with arbvp1.

Definition at line 220 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getPointLightExtruderVs_1_1FiniteDebug | ( | void |  | ) | `[static]`

Get extruder program source for debug point lights, compatible with vs_1_1.

Definition at line 222 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderArbvp1FiniteDebug | ( | void |  | ) | `[static]`

Get FINITE extruder program source for debug directional lights, compatible with arbvp1.

Definition at line 224 of file OgreShadowVolumeExtrudeProgram.h.

static const String& Ogre::ShadowVolumeExtrudeProgram::getDirectionalLightExtruderVs_1_1FiniteDebug | ( | void |  | ) | `[static]`

Get FINITE extruder program source for debug directional lights, compatible with vs_1_1.

Definition at line 226 of file OgreShadowVolumeExtrudeProgram.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

operator new, with debug line info

Definition at line 62 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | `[inherited]`

Definition at line 67 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz,
|  | void * | ptr |
| ) |  |  | `[inherited]`

placement operator new

Definition at line 73 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz,
|  | const char * | file,
|  | int | line,
|  | const char * | func |
| ) |  |  | `[inherited]`

array operator new, with debug line info

Definition at line 79 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | `[inherited]`

Definition at line 84 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | `[inherited]`

Definition at line 89 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | void * |  |
| ) |  |  | `[inherited]`

Definition at line 95 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 101 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | `[inherited]`

Definition at line 106 of file OgreMemoryAllocatedObject.h.

template<class Alloc>

void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr,
|  | const char * | ,
|  | int | ,
|  | const char * |  |
| ) |  |  | `[inherited]`

Definition at line 112 of file OgreMemoryAllocatedObject.h.

## Member Data Documentation

String Ogre::ShadowVolumeExtrudeProgram::mPointArbvp1`[static, private]`

Definition at line 133 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointVs_1_1`[static, private]`

Definition at line 134 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirArbvp1`[static, private]`

Definition at line 135 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirVs_1_1`[static, private]`

Definition at line 136 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointArbvp1Debug`[static, private]`

Definition at line 138 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointVs_1_1Debug`[static, private]`

Definition at line 139 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirArbvp1Debug`[static, private]`

Definition at line 140 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirVs_1_1Debug`[static, private]`

Definition at line 141 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointArbvp1Finite`[static, private]`

Definition at line 143 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointVs_1_1Finite`[static, private]`

Definition at line 144 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirArbvp1Finite`[static, private]`

Definition at line 145 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirVs_1_1Finite`[static, private]`

Definition at line 146 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointArbvp1FiniteDebug`[static, private]`

Definition at line 148 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mPointVs_1_1FiniteDebug`[static, private]`

Definition at line 149 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirArbvp1FiniteDebug`[static, private]`

Definition at line 150 of file OgreShadowVolumeExtrudeProgram.h.

String Ogre::ShadowVolumeExtrudeProgram::mDirVs_1_1FiniteDebug`[static, private]`

Definition at line 151 of file OgreShadowVolumeExtrudeProgram.h.

bool Ogre::ShadowVolumeExtrudeProgram::mInitialised`[static, private]`

Definition at line 153 of file OgreShadowVolumeExtrudeProgram.h.

const String Ogre::ShadowVolumeExtrudeProgram::programNames[OGRE_NUM_SHADOW_EXTRUDER_PROGRAMS]`[static]`

Definition at line 177 of file OgreShadowVolumeExtrudeProgram.h.

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

- OgreShadowVolumeExtrudeProgram.h

Copyright © 2008 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Jul 26 11:37:00 2009