Shaders for Shadows
Shader code for rendering shadows of translucent occluders, soft shadows and single scattering with moment shadow maps.
 All Classes Files Functions Variables Pages
Functions
Constants.fx File Reference

Go to the source code of this file.

Functions

void InvertMatrix (out float4x4 OutBToA, float4x4 AToB)
 
void TransformMatrix (out float4x4 OutAToCSpace, float4x4 AToBSpace, float4x4 BToCSpace)
 
void ComputeAverageScaling (out float OutAverageScaling, float4x4 Matrix)
 
void ComputeClippingPlanes (out float4 OutLeft, out float4 OutRight, out float4 OutTop, out float4 OutBottom, out float4 OutNear, out float4 OutFar, float4x4 WorldToProjectionSpace)
 
void ComputeBillboardData (out float3 OutBillboardNormal, out float3 BillboardUpVector, out float3 BillboardRightVector, out float3 BillboardScaledUpVector, out float3 BillboardScaledRightVector, float2 BillboardSize, float4x4 WorldToViewSpace)
 
void ComputeWorldSpaceCameraPosition (out float3 OutWorldSpaceCameraPosition, float4x4 ViewToWorldSpace)
 
void ComputeMeshSpaceCameraPosition (out float3 OutMeshSpaceCameraPosition, float4x4 ViewToMeshSpace)
 

Detailed Description

This module provides functions that are used by CConstantManager to define redundant constants.

Definition in file Constants.fx.

Function Documentation

void ComputeAverageScaling ( out float  OutAverageScaling,
float4x4  Matrix 
)

This function computes a uniform scaling value that matches the scaling in the given matrix best and returns it.

Definition at line 40 of file Constants.fx.

void ComputeBillboardData ( out float3  OutBillboardNormal,
out float3  BillboardUpVector,
out float3  BillboardRightVector,
out float3  BillboardScaledUpVector,
out float3  BillboardScaledRightVector,
float2  BillboardSize,
float4x4  WorldToViewSpace 
)

This function computes a normalized vector, which is orthogonal to the near clipping plane and points out of the view frustum (a normal vector for billboards). Besides it computes a tangent and a bitangent for billboards and scaled versions of these values.

Definition at line 93 of file Constants.fx.

void ComputeClippingPlanes ( out float4  OutLeft,
out float4  OutRight,
out float4  OutTop,
out float4  OutBottom,
out float4  OutNear,
out float4  OutFar,
float4x4  WorldToProjectionSpace 
)

Given a world to projection space transformation this function computes the six clipping planes and normalizes them.

Definition at line 49 of file Constants.fx.

void ComputeMeshSpaceCameraPosition ( out float3  OutMeshSpaceCameraPosition,
float4x4  ViewToMeshSpace 
)

This function computes the mesh space position of the camera.

Definition at line 111 of file Constants.fx.

void ComputeWorldSpaceCameraPosition ( out float3  OutWorldSpaceCameraPosition,
float4x4  ViewToWorldSpace 
)

This function computes the world space position of the camera.

Definition at line 106 of file Constants.fx.

void InvertMatrix ( out float4x4  OutBToA,
float4x4  AToB 
)

This function computes the multiplicative inverse of a matrix whose last column is 0 0 0 1.

Definition at line 7 of file Constants.fx.

void TransformMatrix ( out float4x4  OutAToCSpace,
float4x4  AToBSpace,
float4x4  BToCSpace 
)

This function transforms one matrix by another matrix.

Definition at line 33 of file Constants.fx.