mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 13:23:36 +02:00
Cleanup the shaders to avoid any uniform in genral, fixed a bug woith the emissive params applied twice for model_lightmap.slf
This commit is contained in:
parent
5a67411d75
commit
fd3efa37e3
4 changed files with 2 additions and 8 deletions
|
@ -218,10 +218,6 @@ void MeshPartPayload::bindMaterial(gpu::Batch& batch, const ShapePipeline::Locat
|
|||
|
||||
if (lightmapMap && lightmapMap->isDefined()) {
|
||||
batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, lightmapMap->getTextureView());
|
||||
|
||||
auto lightmapOffsetScale = lightmapMap->getLightmapOffsetScale();
|
||||
batch._glUniform2f(locations->emissiveParams, lightmapOffsetScale.x, lightmapOffsetScale.y);
|
||||
|
||||
} else {
|
||||
batch.setResourceTexture(ShapePipeline::Slot::EMISSIVE_LIGHTMAP_MAP, textureCache->getGrayTexture());
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ void main(void) {
|
|||
Material mat = getMaterial();
|
||||
int matKey = getMaterialKey(mat);
|
||||
<$fetchMaterialTextures(matKey, _texCoord0, albedo, roughness)$>
|
||||
<$fetchMaterialLightmap(_texCoord1, emissive)$>
|
||||
<$fetchMaterialLightmap(_texCoord1, lightmapVal)$>
|
||||
|
||||
|
||||
packDeferredFragmentLightmap(
|
||||
|
@ -40,5 +40,5 @@ void main(void) {
|
|||
getMaterialRoughness(mat) * roughness,
|
||||
getMaterialMetallic(mat),
|
||||
getMaterialFresnel(mat),
|
||||
(vec3(emissiveParams.x) + emissiveParams.y * emissive.rgb));
|
||||
lightmapVal);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,6 @@ void ShapePlumber::addPipeline(const Filter& filter, const gpu::ShaderPointer& p
|
|||
gpu::Shader::makeProgram(*program, slotBindings);
|
||||
|
||||
auto locations = std::make_shared<Locations>();
|
||||
locations->emissiveParams = program->getUniforms().findLocation("emissiveParams");
|
||||
locations->normalFittingMapUnit = program->getTextures().findLocation("normalFittingMap");
|
||||
locations->albedoTextureUnit = program->getTextures().findLocation("albedoMap");
|
||||
locations->roughnessTextureUnit = program->getTextures().findLocation("roughnessMap");
|
||||
|
|
|
@ -215,7 +215,6 @@ public:
|
|||
int metallicTextureUnit;
|
||||
int emissiveTextureUnit;
|
||||
int occlusionTextureUnit;
|
||||
int emissiveParams;
|
||||
int normalFittingMapUnit;
|
||||
int skinClusterBufferUnit;
|
||||
int materialBufferUnit;
|
||||
|
|
Loading…
Reference in a new issue