paysages3d/src/render/software/TerrainRasterizer.h

59 lines
1.2 KiB
C
Raw Normal View History

2013-12-05 15:44:18 +00:00
#ifndef TERRAINRASTERIZER_H
#define TERRAINRASTERIZER_H
#include "software_global.h"
#include "Vector3.h"
namespace paysages {
namespace software {
class SOFTWARESHARED_EXPORT TerrainRasterizer
{
public:
typedef struct
{
Vector3 point_nw;
Vector3 point_sw;
Vector3 point_se;
Vector3 point_ne;
int detail_hint;
} TerrainChunkInfo;
public:
TerrainRasterizer(SoftwareRenderer* renderer);
/**
* Method called for each chunk tessellated by getTessellationInfo.
*/
int processChunk(TerrainChunkInfo* chunk, double progress);
/**
* Tessellate the terrain, calling processChunk for each chunk.
*
* The terrain will be broken in chunks, most detailed near the camera.
*/
void getTessellationInfo(int displaced);
/**
* Tessellate a terrain chunk, pushing the quads in the render area.
*/
void tessellateChunk(TerrainChunkInfo* chunk, int detail);
/**
* Start the final rasterization of terrain.
*
* This will push the rasterized quads in the render area, waiting for post process.
*/
void renderSurface();
private:
SoftwareRenderer* renderer;
2014-01-02 14:08:00 +00:00
ParallelQueue* queue;
2013-12-05 15:44:18 +00:00
};
}
}
#endif // TERRAINRASTERIZER_H