Showing the changes to libraries/render-utils/src/Model.cpp (1 of 8 files). Show all
Unified · Split
| @@ -105,6 +105,8 @@ void Model::RenderPipelineLib::addRenderPipeline(Model::RenderKey key, · 104 unmodified lines | ||
| 105 | 105 | slotBindings.insert(gpu::Shader::Binding(std::string("specularMap"), 2)); |
| 106 | 106 | slotBindings.insert(gpu::Shader::Binding(std::string("emissiveMap"), 3)); |
| 107 | 107 | slotBindings.insert(gpu::Shader::Binding(std::string("lightBuffer"), 4)); |
| 108 | + slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), DeferredLightingEffect::NORMAL_FITTING_MAP_SLOT)); | |
| 109 | + | |
| 108 | 110 | |
| 109 | 111 | gpu::ShaderPointer program = gpu::ShaderPointer(gpu::Shader::createProgram(vertexShader, pixelShader)); |
| 110 | 112 | gpu::Shader::makeProgram(*program, slotBindings); |
| @@ -180,6 +182,8 @@ void Model::RenderPipelineLib::initLocations(gpu::ShaderPointer& program, Model: · 69 unmodified lines | ||
| 180 | 182 | locations.emissiveParams = program->getUniforms().findLocation("emissiveParams"); |
| 181 | 183 | locations.glowIntensity = program->getUniforms().findLocation("glowIntensity"); |
| 182 | 184 | |
| 185 | + locations.normalFittingMapUnit = program->getTextures().findLocation("normalFittingMap"); | |
| 186 | + | |
| 183 | 187 | locations.specularTextureUnit = program->getTextures().findLocation("specularMap"); |
| 184 | 188 | locations.emissiveTextureUnit = program->getTextures().findLocation("emissiveMap"); |
| 185 | 189 | |
| @@ -1864,6 +1868,10 @@ void Model::pickPrograms(gpu::Batch& batch, RenderMode mode, bool translucent, f · 1678 unmodified lines | ||
| 1864 | 1868 | const float DEFAULT_GLOW_INTENSITY = 1.0f; // FIXME - glow is removed |
| 1865 | 1869 | batch._glUniform1f(locations->glowIntensity, DEFAULT_GLOW_INTENSITY); |
| 1866 | 1870 | } |
| 1871 | + | |
| 1872 | + if ((locations->normalFittingMapUnit > -1)) { | |
| 1873 | + batch.setResourceTexture(locations->normalFittingMapUnit, DependencyManager::get<TextureCache>()->getNormalFittingTexture()); | |
| 1874 | + } | |
| 1867 | 1875 | } |
| 1868 | 1876 | |
| 1869 | 1877 | bool Model::initWhenReady(render::ScenePointer scene) { |