|
Public Member Functions |
| EnvMap () |
void | SetCamera (CModelViewerCamera *camera) |
void | InvalidateCubeMap () |
void | InvalidateShininess () |
void | InvalidateResolution () |
D3DXVECTOR3 & | GetReferencePos () |
void | ChooseMesh (int whichMesh) |
| Loads the specified mesh.
|
void | SetMeshSize (float d) |
void | SetMeshPosition (D3DXVECTOR3 pos) |
D3DXVECTOR3 | GetMeshPosition () |
void | KeyboardProc (UINT nChar, bool bKeyDown, bool bAltDown) |
| Handles keystroke messages.
|
void | DoRendering (D3DXMATRIXA16 &mView, D3DXMATRIXA16 &mProj) |
| Render the scene.
|
void | DrawCenterObjects (D3DXMATRIXA16 &mView, D3DXMATRIXA16 &mProj) |
| Draw the central diffuse/glossy object.
|
void | DrawEnvObjects (D3DXMATRIXA16 &mView, D3DXMATRIXA16 &mProj) |
| Draw environment objects.
|
void | SetWorldViewProj (D3DXMATRIXA16 &mWorld, D3DXMATRIXA16 &mView, D3DXMATRIXA16 &mProj) |
| Uploads the specified world/view/projection transformation matrices to the GPU.
|
D3DXMATRIXA16 | ScaleAndOffset (float fScale, D3DXVECTOR3 vOffset) |
D3DXMATRIXA16 | ScaleAndOffset (D3DXVECTOR3 vScale, D3DXVECTOR3 vOffset) |
void | RenderCubeMap (IDirect3DCubeTexture9 *pCubeTexture) |
| Renders the environment into the specified cubemap.
|
IDirect3DTexture9 * | GenerateCosTexture (eval_fn evaluator) |
| Generates precomputed texture to store values for the reflectivity integral. Uses the eval() function.
|
void | GenerateCosTextureIfNotFound (wchar_t *fileName, eval_fn evaluator) |
| Calls GenerateCosTexture() if the specified texture is not yet calculated and stored as a texture in the cos subdirectory.
|
void | OnFrameRender (IDirect3DDevice9 *pd3dDevice, D3DXMATRIXA16 &mView, D3DXMATRIXA16 &mProj) |
| Performs prepocessing steps if necessary and then renders the scene.
|
void | OnCreateDevice (IDirect3DDevice9 *pd3dDevice, ID3DXEffect *g_pEffect) |
| Called by OnCreateDevice() (Main.cpp) to perform app-specific tasks.
|
void | OnDestroyDevice () |
| Called by OnDestroyDevice() (Main.cpp) to perform app-specific tasks.
|
void | OnResetDevice () |
| Called by OnResetDevice() (Main.cpp) to perform app-specific tasks.
|
void | OnLostDevice () |
| Called by OnLostDevice() (Main.cpp) to perform app-specific tasks.
|
void | InitFullScreenQuad () |
void | DrawFullScreenQuad () |
void | ReduceCubeMapSize (IDirect3DCubeTexture9 *pSourceCube, IDirect3DCubeTexture9 *pDestCube) |
| Downsample a cube map to resolution LR_CUBEMAP_SIZE.
|
void | PreConvolve (IDirect3DCubeTexture9 *pSourceCube, IDirect3DCubeTexture9 *pDestCube) |
| Calculates the irradiance map by convolution.
|
void | SaveCubeMap (IDirect3DCubeTexture9 *pCubeTexture, char *FileNamePrefix, char *FileNameSuffix="") |
IDirect3DCubeTexture9 * | CreateCubeTexture (int size, D3DFORMAT Format) |
Public Attributes |
IDirect3DVertexBuffer9 * | pVertexBuffer |
Private Types |
typedef float(* | eval_fn )(float, float) |
| Callback function to evaluate reflectivity integral. See GenerateCosTexture() and eval().
|
Private Attributes |
IDirect3DDevice9 * | pd3dDevice |
| THE D3D DEVICE.
|
ID3DXEffect * | g_pEffect |
| THE EFFECT FILE.
|
CModelViewerCamera * | camera |
| Rotate/zoom camera, always looking to the origin.
|
HRESULT | hr |
IDirect3DCubeTexture9 * | pCubeTexture |
| Cubemap that stores the environment as seen from the reference point. See method RenderCubeMap().
|
IDirect3DCubeTexture9 * | pCubeTextureSmall |
| Low-resolution (downsampled) cubemap, derived from pCubeTexture. See ReduceCubeMapSize().
|
IDirect3DCubeTexture9 * | pCubeTexturePreConvolved |
| Low-resolution cubemap that stores preconvolved data for diffuse/specular environment mapping. See method PreConvolve().
|
IDirect3DTexture9 * | pCosValuesTexture |
| Helper texture with precomputed geometric factor values.
|
IDirect3DTexture9 * | pRoomTexture |
| Texture to be displayed on the walls of the cubic room.
|
bool | bCubeMapIsValid |
bool | bShininessIsValid |
| indicates that the cube map has to be re-generated
|
Cube * | cube |
| indicates that the reflectivity integral has to be re-calculated
|
float | roomSize |
| Simple cube centralMesh for the room. See EnvMap::DrawEnvObjects().
|
Mesh * | centralMesh |
| Size of the cubic room.
|
Mesh * | meshes [10] |
| The diffuse/glossy object to be shaded.
|
int | meshCount |
| Objects of the environment (fireballs, etc.).
|
D3DXVECTOR3 | reference_pos |
| Number of objects in the environment.
|