C# Class Axiom.Graphics.ShadowVolumeExtrudeProgram

Static class containing source for vertex programs for extruding shadow volumes.
This exists so we don't have to be dependent on an external media files. is used so we don't have to rely on particular plugins. 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 // homogenous, 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, // homogenous, 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, // homogenous, 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); }
ファイルを表示 Open project: WolfgangSt/axiom Class Usage Examples

Public Properties

Property Type Description
programNames string[]

Public Methods

Method Description
GetProgramName ( LightType lightType, bool finite, bool debug ) : string

General purpose method to get any of the program names based on the specified parameters.

GetProgramName ( Programs type ) : string

Gets the name of the program for the given type.

GetProgramSource ( LightType lightType, string syntax, bool finite, bool debug ) : string

General purpose method to get any of the program sources.

Initialize ( ) : void

Initialize the creation of these core vertex programs.

Shutdown ( ) : void

Called on engine shutdown; destroys all auto created gpu programs.

Private Methods

Method Description
ShadowVolumeExtrudeProgram ( ) : System

This is a static class; don't allow instantiation.

Method Details

GetProgramName() public static method

General purpose method to get any of the program names based on the specified parameters.
public static GetProgramName ( LightType lightType, bool finite, bool debug ) : string
lightType LightType Type of light to get the source for.
finite bool Is this for finite volume extrusion?
debug bool Should the shadow volumes be visible?
return string

GetProgramName() public static method

Gets the name of the program for the given type.
public static GetProgramName ( Programs type ) : string
type Programs
return string

GetProgramSource() public static method

General purpose method to get any of the program sources.
public static GetProgramSource ( LightType lightType, string syntax, bool finite, bool debug ) : string
lightType LightType Type of light to get the source for.
syntax string Syntax code of interest.
finite bool Is this for finite volume extrusion?
debug bool Should the shadow volumes be visible?
return string

Initialize() public static method

Initialize the creation of these core vertex programs.
public static Initialize ( ) : void
return void

Shutdown() public static method

Called on engine shutdown; destroys all auto created gpu programs.
public static Shutdown ( ) : void
return void

Property Details

programNames public_oe static_oe property

public static string[] programNames
return string[]