mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 17:20:27 +02:00
Fixing the procedural shader flickering key lighting, this is due to the LightingMOdel binding slot not assigned
This commit is contained in:
parent
efca568dbe
commit
0e66ca1dfd
1 changed files with 19 additions and 14 deletions
|
@ -273,11 +273,16 @@ void Procedural::prepare(gpu::Batch& batch, const glm::vec3& position, const glm
|
|||
// qCDebug(procedural) << "FragmentShader:\n" << fragmentShaderSource.c_str();
|
||||
|
||||
gpu::Shader::BindingSet slotBindings;
|
||||
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("iChannel0"), 0));
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("iChannel1"), 1));
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("iChannel2"), 2));
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("iChannel3"), 3));
|
||||
|
||||
// TODO: THis is a simple fix, we need a cleaner way to provide the "hosting" program for procedural custom shaders to be defined together with the required bindings.
|
||||
const int PROCEDURAL_PROGRAM_LIGHTING_MODEL_SLOT = 3;
|
||||
slotBindings.insert(gpu::Shader::Binding(std::string("lightingModelBuffer"), PROCEDURAL_PROGRAM_LIGHTING_MODEL_SLOT));
|
||||
|
||||
_opaqueFragmentShader = gpu::Shader::createPixel(opaqueShaderSource);
|
||||
_opaqueShader = gpu::Shader::createProgram(_vertexShader, _opaqueFragmentShader);
|
||||
gpu::Shader::makeProgram(*_opaqueShader, slotBindings);
|
||||
|
|
Loading…
Reference in a new issue