mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-02 05:41:49 +00:00
41 lines
No EOL
947 B
C++
41 lines
No EOL
947 B
C++
#ifndef __GL_LENSSHADER_H
|
|
#define __GL_LENSSHADER_H
|
|
|
|
#include "gl_shaderprogram.h"
|
|
|
|
class FLensShader
|
|
{
|
|
public:
|
|
void Bind();
|
|
|
|
FBufferedUniformSampler InputTexture;
|
|
|
|
struct UniformBlock
|
|
{
|
|
float AspectRatio;
|
|
float Scale;
|
|
float Padding0, Padding1;
|
|
FVector4 LensDistortionCoefficient;
|
|
FVector4 CubicDistortionValue;
|
|
|
|
static std::vector<UniformFieldDesc> Desc()
|
|
{
|
|
return
|
|
{
|
|
{ "Aspect", UniformType::Float, offsetof(UniformBlock, AspectRatio) },
|
|
{ "Scale", UniformType::Float, offsetof(UniformBlock, Scale) },
|
|
{ "Padding0", UniformType::Float, offsetof(UniformBlock, Padding0) },
|
|
{ "Padding1", UniformType::Float, offsetof(UniformBlock, Padding1) },
|
|
{ "k", UniformType::Vec4, offsetof(UniformBlock, LensDistortionCoefficient) },
|
|
{ "kcube", UniformType::Vec4, offsetof(UniformBlock, CubicDistortionValue) }
|
|
};
|
|
}
|
|
};
|
|
|
|
ShaderUniforms<UniformBlock> Uniforms;
|
|
|
|
private:
|
|
FShaderProgram mShader;
|
|
};
|
|
|
|
#endif |