44 lines
1 KiB
C++
44 lines
1 KiB
C++
#pragma once
|
|
|
|
#include "software_global.h"
|
|
|
|
#include "SoftwareCanvasRenderer.h"
|
|
|
|
#include <memory>
|
|
|
|
namespace paysages {
|
|
namespace software {
|
|
|
|
/**
|
|
* Software rendering using only ray tracing, not rasterization.
|
|
*
|
|
* Follows these steps, for each view ray :
|
|
* - Find a ray intersection with solid matter
|
|
* - Texture/light the solid matter (may need other secondary rays)
|
|
* - Apply medium traversal along the ray (e.g. atmosphere)
|
|
*/
|
|
class SOFTWARESHARED_EXPORT SoftwareRayRenderer : public SoftwareCanvasRenderer {
|
|
public:
|
|
SoftwareRayRenderer(Scenery *scenery, bool standard = true);
|
|
virtual ~SoftwareRayRenderer();
|
|
|
|
/**
|
|
* Register standard scenery intersectors.
|
|
*/
|
|
void registerStandardIntersectors();
|
|
|
|
protected:
|
|
/**
|
|
* Render a single canvas portion using ray-tracing.
|
|
*/
|
|
virtual void renderPortion(CanvasPortion *portion, RenderProgress *progress, bool *interrupt);
|
|
|
|
virtual void prepare() override;
|
|
|
|
private:
|
|
class pimpl;
|
|
unique_ptr<pimpl> impl;
|
|
};
|
|
}
|
|
}
|