source: trunk/VUT/GtpVisibilityPreprocessor/src/RenderSimulator.h @ 407

Revision 407, 1.3 KB checked in by mattausch, 19 years ago (diff)
Line 
1#ifndef _RenderSimulator_h__
2#define _RenderSimulator_h__
3
4#include "common.h"
5
6class BspTree;
7class KdTree;
8class ViewCell;
9class KdLeaf;
10
11/** Simulated rendering using a simple render heuristics. Used to evaluate the
12        quality of the view cell partition.
13*/
14class RenderSimulator
15{
16public:
17        RenderSimulator();
18        RenderSimulator(float objRendercost, float vcOverhead);
19        virtual Real SimulateRendering() = 0;
20
21protected:
22        // render time for single object of the PVS
23        float mObjRenderCost;
24        // const overhead for crossing a view cell border
25        float mVcOverhead;
26};
27
28class BspTreeRenderSimulator: public RenderSimulator
29{
30public:
31        BspTreeRenderSimulator(float objRenderCost, float vcOverhead, BspTree *bspTree);
32
33        Real SimulateRendering();
34
35protected:
36        /** Simulates rendering of the pvs of one view cell, with given rendering time for an object.
37                @param viewCell the view cell holding the Pvs
38                @param objRenderTime estimated render time for one object of the Pvs
39        */
40        Real RenderPvs(ViewCell &viewCell, const float objRenderTime) const;
41
42        BspTree *mBspTree;
43};
44
45class KdTreeRenderSimulator: public RenderSimulator
46{
47public:
48        KdTreeRenderSimulator(float objRenderCost, float vcOverhead, KdTree *kdTree);
49        Real SimulateRendering();
50
51protected:
52
53        Real RenderPvs(KdLeaf *leaf, float objRenderTime) const;
54
55        KdTree *mKdTree;
56};
57
58#endif // RenderSimulator
Note: See TracBrowser for help on using the repository browser.