demotool/raymarcher.hh

43 lines
913 B
C++

#pragma once
#include "rendertarget.hh"
#include "shaders.hh"
#include "camera.hh"
struct T_Raymarcher
{
public:
T_Raymarcher( ) = delete;
T_Raymarcher( T_Raymarcher const& ) = delete;
T_Raymarcher( T_Raymarcher&& ) = delete;
T_Raymarcher( __rd__ const uint32_t width ,
__rd__ const uint32_t height );
void render( );
void makeUI( );
T_Camera const& camera( ) const noexcept { return camera_; }
T_Camera& camera( ) noexcept { return camera_; }
T_Texture& output( ) noexcept { return txOutput_; }
T_Texture& depth( ) noexcept { return txDepth_; }
private:
T_Camera camera_;
//T_ShaderProgram program_;
T_ShaderPipeline program_;
T_Texture txOutput_ , txDepth_;
T_Rendertarget rtOutput_;
int rmIterations = 256;
float rmStep = 1.2;
float rmEpsilon = .00001;
float rmMaxDist = 250;
float fog = .00015;
int correction_ = 10;
float epsLog = log( rmEpsilon ) / log( 10 );
};