Moved more shaders.
This commit is contained in:
parent
52017e31ea
commit
553a0a8b58
@ -457,19 +457,6 @@ namespace FullScreenShader
|
|||||||
assignUniforms("direction", "col");
|
assignUniforms("direction", "col");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ShadowMatrixesGenerationShader::ShadowMatrixesGenerationShader()
|
|
||||||
{
|
|
||||||
loadProgram(OBJECT,
|
|
||||||
GL_COMPUTE_SHADER, "shadowmatrixgeneration.comp");
|
|
||||||
assignUniforms("SunCamMatrix");
|
|
||||||
GLuint block_idx = glGetProgramResourceIndex(m_program, GL_SHADER_STORAGE_BLOCK, "BoundingBoxes");
|
|
||||||
glShaderStorageBlockBinding(m_program, block_idx, 2);
|
|
||||||
block_idx = glGetProgramResourceIndex(m_program, GL_SHADER_STORAGE_BLOCK, "NewMatrixData");
|
|
||||||
glShaderStorageBlockBinding(m_program, block_idx, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
GlowShader::GlowShader()
|
GlowShader::GlowShader()
|
||||||
{
|
{
|
||||||
loadProgram(OBJECT,
|
loadProgram(OBJECT,
|
||||||
|
@ -88,13 +88,6 @@ public:
|
|||||||
SunLightShader();
|
SunLightShader();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ShadowMatrixesGenerationShader : public Shader <ShadowMatrixesGenerationShader, core::matrix4>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
ShadowMatrixesGenerationShader();
|
|
||||||
};
|
|
||||||
|
|
||||||
class GlowShader : public TextureShader<GlowShader, 1>
|
class GlowShader : public TextureShader<GlowShader, 1>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -53,6 +53,28 @@ public:
|
|||||||
} // LightspaceBoundingBoxShader
|
} // LightspaceBoundingBoxShader
|
||||||
}; // LightspaceBoundingBoxShader
|
}; // LightspaceBoundingBoxShader
|
||||||
|
|
||||||
|
// ============================================================================
|
||||||
|
class ShadowMatricesGenerationShader
|
||||||
|
: public Shader <ShadowMatricesGenerationShader, core::matrix4>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ShadowMatricesGenerationShader()
|
||||||
|
{
|
||||||
|
loadProgram(OBJECT, GL_COMPUTE_SHADER, "shadowmatrixgeneration.comp");
|
||||||
|
assignUniforms("SunCamMatrix");
|
||||||
|
GLuint block_idx =
|
||||||
|
glGetProgramResourceIndex(m_program,
|
||||||
|
GL_SHADER_STORAGE_BLOCK, "BoundingBoxes");
|
||||||
|
glShaderStorageBlockBinding(m_program, block_idx, 2);
|
||||||
|
block_idx =
|
||||||
|
glGetProgramResourceIndex(m_program, GL_SHADER_STORAGE_BLOCK,
|
||||||
|
"NewMatrixData");
|
||||||
|
glShaderStorageBlockBinding(m_program, block_idx, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}; // ShadowMatricesGenerationShader
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
static std::vector<vector3df> getFrustrumVertex(const scene::SViewFrustum &frustrum)
|
static std::vector<vector3df> getFrustrumVertex(const scene::SViewFrustum &frustrum)
|
||||||
{
|
{
|
||||||
@ -194,8 +216,8 @@ void IrrDriver::updateSplitAndLightcoordRangeFromComputeShaders(size_t width,
|
|||||||
GL_STATIC_COPY);
|
GL_STATIC_COPY);
|
||||||
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, tempShadowMatssbo);
|
glBindBufferBase(GL_SHADER_STORAGE_BUFFER, 1, tempShadowMatssbo);
|
||||||
|
|
||||||
FullScreenShader::ShadowMatrixesGenerationShader::getInstance()->use();
|
ShadowMatricesGenerationShader::getInstance()->use();
|
||||||
FullScreenShader::ShadowMatrixesGenerationShader::getInstance()
|
ShadowMatricesGenerationShader::getInstance()
|
||||||
->setUniforms(m_suncam->getViewMatrix());
|
->setUniforms(m_suncam->getViewMatrix());
|
||||||
glDispatchCompute(4, 1, 1);
|
glDispatchCompute(4, 1, 1);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user