OGRE  1.11.0
Object-Oriented Graphics Rendering Engine
Ogre::ShadowVolumeExtrudeProgram Class Reference

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

#include <OgreShadowVolumeExtrudeProgram.h>

+ Inheritance diagram for Ogre::ShadowVolumeExtrudeProgram:

Static Public Member Functions

static const GpuProgramPtrget (Light::LightTypes lightType, bool finite, bool debug=false)
 
static void initialise (void)
 Initialise the creation of these vertex programs. More...
 
static void shutdown (void)
 Shutdown & destroy the vertex programs. More...
 

Static Public Attributes

static HighLevelGpuProgramPtr frgProgram
 

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);
}

Member Function Documentation

◆ initialise()

static void Ogre::ShadowVolumeExtrudeProgram::initialise ( void  )
static

Initialise the creation of these vertex programs.

◆ shutdown()

static void Ogre::ShadowVolumeExtrudeProgram::shutdown ( void  )
static

Shutdown & destroy the vertex programs.

◆ get()

static const GpuProgramPtr& Ogre::ShadowVolumeExtrudeProgram::get ( Light::LightTypes  lightType,
bool  finite,
bool  debug = false 
)
static

Member Data Documentation

◆ frgProgram

HighLevelGpuProgramPtr Ogre::ShadowVolumeExtrudeProgram::frgProgram
static

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