shadbuf.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: shadbuf.h : Shadow buffer renderer.
00004 
00005     DESCRIPTION:
00006 
00007     CREATED BY: Dan Silva
00008 
00009     HISTORY:
00010 
00011  *> Copyright (c) 1994, All Rights Reserved.
00012  **********************************************************************/
00013 
00014 #pragma once
00015 #include <WTypes.h>
00016 #include "maxheap.h"
00017 #include "matrix3.h"
00018 
00019 // forward declarations
00020 class RendContext;
00021 class RenderGlobalContext;
00022 class ObjLightDesc;
00023 
00068 class ShadBufRenderer: public MaxHeapOperators {
00069     public:
00102         virtual int Render(
00103             RendContext &rc, 
00104             RenderGlobalContext *RGC, 
00105             float *buf,         // preallocated (shadsize*shadsize)  floats 
00106             BOOL parallel,      // parallel or perspective projection
00107             int shadsize,      // size of the buffer (shadsize by shadsize pixels)
00108             float param,       // persp:field-of-view (radians) -- parallel : width in world coords
00109             float aspect,      // aspect ration of the buffer projection 
00110             float clipDist,    // don't consider objects farther than this from light
00111             ObjLightDesc *ltDesc, // descriptor for light that was passed in to CreateShadowGenerator
00112             Matrix3 worldToLight  // world to light transfor for light
00113             )=0;
00116         virtual float Furthest()=0; // after render, this gives the farthest Z in the buffer
00119         virtual float Closest()=0;  // after render, this gives the closest Z in the buffer.
00121         virtual void DeleteThis()=0;
00122     };
00123 
00126 CoreExport ShadBufRenderer *NewDefaultShadBufRenderer();
00127