|
Defines |
#define | CUBEMAP_SIZE 128 |
| size of the cube map taken from the reference point of the object
|
#define | PI 3.14159f |
#define | _ReduceTexturePS(M) |
| Downsamples a cube map face.
|
#define | _ConvolutionPS(M) |
| Convolves the values of a cube map of resoultion MxM.
|
#define | _EnvMapDiffuseLocalizedPS(M) |
| Calculates diffuse or specular contributions of all texels in SmallEnvironmentMap to the current point. For each texel of SmallEnvironmentMap, function GetContr(int,float3,float3,float3,float3) is called.
|
#define | TechniqueUsingCommonVS(name) |
| a helpful macro to define techniques with a common vertex program
|
#define | ReduceTextureTechnique(M) |
#define | ConvolutionTechnique(M) |
#define | Technique(name) |
Functions |
void | ReduceTextureVS (float4 position:POSITION, float4 color0:COLOR0, float3 Normal:NORMAL, float2 Tex:TEXCOORD0, out float4 hposition:POSITION, out float4 color:COLOR0, out float2 oTex:TEXCOORD0, out float4 pos:TEXCOORD1) |
| _ReduceTexturePS (2) |
| _ReduceTexturePS (4) |
| _ReduceTexturePS (8) |
| _ReduceTexturePS (16) |
float4 | GetContr (float3 q, float3 L) |
| Returns the precalculated contribution of a texel with regard to the specified query direction.
|
_ConvolutionVS_output | ConvolutionVS (_ConvolutionVS_input IN) |
| _ConvolutionPS (2) |
| _ConvolutionPS (4) |
| _ConvolutionPS (8) |
| _ConvolutionPS (16) |
_EnvMapVS_output | EnvMapVS (_EnvMapVS_input IN) |
float4 | EnvMapDiffuseClassicPS (_EnvMapVS_output IN) |
| Determines diffuse or specular illumination with a single lookup into PreconvolvedEnvironmentMap.
|
float4 | GetContr (int M, float3 L, float3 pos, float3 N, float3 V) |
| Calculates the contribution of a single texel of SmallEnvironmentMap to the illumination of the shaded point. To compute reflectivity, precalculated integral values are used.
|
| _EnvMapDiffuseLocalizedPS (2) |
| _EnvMapDiffuseLocalizedPS (4) |
| _EnvMapDiffuseLocalizedPS (8) |
| _EnvMapDiffuseLocalizedPS (16) |
float4 | EnvMapDiffuseLocalized5TexPS (_EnvMapVS_output IN) |
| Calculates diffuse or specular contributions of the 5 "most important" texels of SmallEnvironmentMap to the current point. For these texels, function GetContr(int,float3,float3,float3,float3) is called.
|
_IlluminatedSceneVS_output | IlluminatedSceneVS (_IlluminatedSceneVS_input IN) |
float4 | IlluminatedScenePS (_IlluminatedSceneVS_output IN) |
| Displays the environment with a simple shading.
|
| TechniqueUsingCommonVS (EnvMapDiffuseClassic) |
| TechniqueUsingCommonVS (EnvMapDiffuseLocalized5Tex) |
| TechniqueUsingCommonVS (EnvMapDiffuseLocalized2) |
| TechniqueUsingCommonVS (EnvMapDiffuseLocalized4) |
| TechniqueUsingCommonVS (EnvMapDiffuseLocalized8) |
| TechniqueUsingCommonVS (EnvMapDiffuseLocalized16) |
| ReduceTextureTechnique (2) |
| ReduceTextureTechnique (4) |
| ReduceTextureTechnique (8) |
| ReduceTextureTechnique (16) |
| ConvolutionTechnique (2) |
| ConvolutionTechnique (4) |
| ConvolutionTechnique (8) |
| ConvolutionTechnique (16) |
| Technique (IlluminatedScene) |
Variables |
int | LR_CUBEMAP_SIZE |
| size of the cube map for diffuse/glossy reflections
|
float4x4 | World |
| World matrix for the current object.
|
float4x4 | WorldIT |
| World matrix IT (inverse transposed) to transform surface normals of the current object.
|
float4x4 | WorldView |
| World * View matrix.
|
float4x4 | WorldViewProjection |
| World * View * Projection matrix.
|
float | texel_size |
| upload this constant every time the viewport changes
|
float4 | eyePos |
| current eye (camera) position
|
float4 | reference_pos |
| Reference point for the last cube map generation.
|
int | nFace |
int | iShowCubeMap |
float4 | objColor |
float | intensity |
float | shininess |
float | brightness |
texture | EnvironmentMap |
texture | SmallEnvironmentMap |
texture | PreconvolvedEnvironmentMap |
texture | Decoration |
sampler | EnvironmentMapSampler |
sampler | PreconvolvedEnvironmentMapSampler |
sampler | SmallEnvironmentMapSampler |
sampler | DecorationSampler |
|
Value: float4 EnvMapDiffuseLocalized##M##PS( _EnvMapVS_output IN ) : COLOR \
{ \
IN.View = -normalize( IN.View ); \
IN.Normal = normalize( IN.Normal ); \
IN.Position -= reference_pos.xyz; \
\
float3 R = -reflect( IN.View, IN.Normal ); \
\
float4 I = 0; \
\
for (int x = 0; x < M; x++) \
for (int y = 0; y < M; y++) \
{ \
\
\
float2 tpos = float2( (x+0.5f)/M, (y+0.5f)/M ); \
\
float2 p = float2(tpos.x, 1-tpos.y); \
p.xy = 2*p.xy - 1; \
\
I += GetContr( M, float3(p.x, p.y, 1), IN.Position, IN.Normal, IN.View ); \
I += GetContr( M, float3(p.x, p.y, -1), IN.Position, IN.Normal, IN.View ); \
I += GetContr( M, float3(p.x, 1, p.y), IN.Position, IN.Normal, IN.View ); \
I += GetContr( M, float3(p.x, -1, p.y), IN.Position, IN.Normal, IN.View ); \
I += GetContr( M, float3(1, p.x, p.y), IN.Position, IN.Normal, IN.View ); \
I += GetContr( M, float3(-1, p.x, p.y), IN.Position, IN.Normal, IN.View ); \
} \
\
return intensity * I; \
}
Calculates diffuse or specular contributions of all texels in SmallEnvironmentMap to the current point. For each texel of SmallEnvironmentMap, function GetContr(int,float3,float3,float3,float3) is called.
|