demotool/raymarcher.hh

43 lines
888 B
C++
Raw Normal View History

2017-09-30 21:53:45 +02:00
#pragma once
2017-10-02 09:40:36 +02:00
#include "rendertarget.hh"
#include "shaders.hh"
2017-10-02 10:12:27 +02:00
#include "camera.hh"
2017-09-30 21:53:45 +02:00
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 ,
2017-09-30 21:53:45 +02:00
__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_; }
2017-10-01 18:51:02 +02:00
T_Texture& depth( ) noexcept { return txDepth_; }
2017-09-30 21:53:45 +02:00
private:
T_Camera camera_;
//T_ShaderProgram program_;
T_ShaderPipeline program_;
2017-09-30 21:53:45 +02:00
2017-10-01 18:51:02 +02:00
T_Texture txOutput_ , txDepth_;
2017-09-30 21:53:45 +02:00
T_Rendertarget rtOutput_;
2017-10-03 09:29:04 +02:00
int rmIterations = 256;
float rmStep = 1.2;
float rmEpsilon = .001;
float rmMaxDist = 250;
2017-10-05 09:07:37 +02:00
float fog = .00015;
2017-09-30 21:53:45 +02:00
float epsLog = log( rmEpsilon ) / log( 10 );
};