C# Класс 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); }
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
programNames string[]

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
ShadowVolumeExtrudeProgram ( ) : System

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

Описание методов

GetProgramName() публичный статический метод

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?
Результат string

GetProgramName() публичный статический метод

Gets the name of the program for the given type.
public static GetProgramName ( Programs type ) : string
type Programs
Результат string

GetProgramSource() публичный статический метод

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?
Результат string

Initialize() публичный статический метод

Initialize the creation of these core vertex programs.
public static Initialize ( ) : void
Результат void

Shutdown() публичный статический метод

Called on engine shutdown; destroys all auto created gpu programs.
public static Shutdown ( ) : void
Результат void

Описание свойств

programNames публичное статическое свойство

public static string[] programNames
Результат string[]