crt/shaders.hpp
#pragma once
#include "shader.hpp"
#include "common.hpp"
#include <map>
class DepthBlur: public ImageShader {
private:
const coord_t mind, maxd, diffd;
public:
DepthBlur(unsigned, unsigned);
void get(const Scene*, ShaderInfo&, Img&) const;
};
class DepthFog: public PixelShader {
private:
const Img::rgb_t col;
const coord_t start, sqstart;
const float density; // per unit length
public:
DepthFog(const Img::rgb_t& c, coord_t s, unsigned d);
void get(const Scene*, ShaderInfo::shader_info_t&, Img::rgb_t&) const;
};
class VolumetricLight: public PixelShader {
private:
const vertex_t pos;
const float intensity;
const unsigned maxlen, maxsqlen;
static const coord_t stepsize;
const int samples_max;
public:
VolumetricLight(const vertex_t p, unsigned brightness, unsigned len);
void get(const Scene*, ShaderInfo::shader_info_t&, Img::rgb_t&) const;
};