mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
- move shadowmap uniforms out of FShadowMapShader
This commit is contained in:
parent
965acde9c0
commit
ca570f1e78
3 changed files with 20 additions and 19 deletions
|
@ -639,3 +639,20 @@ public:
|
|||
void UpdateTextures() override;
|
||||
void UpdateSteps() override;
|
||||
};
|
||||
|
||||
struct ShadowMapUniforms
|
||||
{
|
||||
float ShadowmapQuality;
|
||||
float Padding0, Padding1, Padding2;
|
||||
|
||||
static std::vector<UniformFieldDesc> Desc()
|
||||
{
|
||||
return
|
||||
{
|
||||
{ "ShadowmapQuality", UniformType::Float, offsetof(ShadowMapUniforms, ShadowmapQuality) },
|
||||
{ "Padding0", UniformType::Float, offsetof(ShadowMapUniforms, Padding0) },
|
||||
{ "Padding1", UniformType::Float, offsetof(ShadowMapUniforms, Padding1) },
|
||||
{ "Padding2", UniformType::Float, offsetof(ShadowMapUniforms, Padding2) },
|
||||
};
|
||||
}
|
||||
};
|
||||
|
|
|
@ -27,7 +27,7 @@ void FShadowMapShader::Bind(IRenderQueue *q)
|
|||
{
|
||||
if (!mShader)
|
||||
{
|
||||
FString prolog = Uniforms.CreateDeclaration("Uniforms", UniformBlock::Desc());
|
||||
FString prolog = Uniforms.CreateDeclaration("Uniforms", ShadowMapUniforms::Desc());
|
||||
|
||||
mShader.reset(screen->CreateShaderProgram());
|
||||
mShader->Compile(IShaderProgram::Vertex, "shaders/glsl/screenquad.vp", "", 430);
|
||||
|
|
|
@ -2,30 +2,14 @@
|
|||
#define __GL_SHADOWMAPSHADER_H
|
||||
|
||||
#include "hwrenderer/postprocessing/hw_shaderprogram.h"
|
||||
#include "hwrenderer/postprocessing/hw_postprocess.h"
|
||||
|
||||
class FShadowMapShader
|
||||
{
|
||||
public:
|
||||
void Bind(IRenderQueue *q);
|
||||
|
||||
struct UniformBlock
|
||||
{
|
||||
float ShadowmapQuality;
|
||||
float Padding0, Padding1, Padding2;
|
||||
|
||||
static std::vector<UniformFieldDesc> Desc()
|
||||
{
|
||||
return
|
||||
{
|
||||
{ "ShadowmapQuality", UniformType::Float, offsetof(UniformBlock, ShadowmapQuality) },
|
||||
{ "Padding0", UniformType::Float, offsetof(UniformBlock, Padding0) },
|
||||
{ "Padding1", UniformType::Float, offsetof(UniformBlock, Padding1) },
|
||||
{ "Padding2", UniformType::Float, offsetof(UniformBlock, Padding2) },
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
ShaderUniforms<UniformBlock, POSTPROCESS_BINDINGPOINT> Uniforms;
|
||||
ShaderUniforms<ShadowMapUniforms, POSTPROCESS_BINDINGPOINT> Uniforms;
|
||||
|
||||
private:
|
||||
std::unique_ptr<IShaderProgram> mShader;
|
||||
|
|
Loading…
Reference in a new issue