Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 11 files). Show all
Unified · Split
| @@ -544,8 +544,8 @@ void GeometryCache::initializeShapePipelines() { · 543 unmodified lines | |||
| 544 | if (!_simpleOpaquePipeline) { | 544 | if (!_simpleOpaquePipeline) { |
| 545 | _simpleOpaquePipeline = getShapePipeline(false, false, true, false); | 545 | _simpleOpaquePipeline = getShapePipeline(false, false, true, false); |
| 546 | _simpleTransparentPipeline = getShapePipeline(false, true, true, false); | 546 | _simpleTransparentPipeline = getShapePipeline(false, true, true, false); |
| 547 | _simpleOpaqueFadePipeline = getFadingShapePipeline(false, false, true, false, false); | 547 | _simpleOpaqueFadePipeline = getFadingShapePipeline(false, false, false, false, false); |
| 548 | _simpleTransparentFadePipeline = getFadingShapePipeline(false, true, true, false, false); | 548 | _simpleTransparentFadePipeline = getFadingShapePipeline(false, true, false, false, false); |
| 549 | _simpleWirePipeline = getShapePipeline(false, false, true, true); | 549 | _simpleWirePipeline = getShapePipeline(false, false, true, true); |
| 550 | } | 550 | } |
| 551 | } | 551 | } |
| @@ -554,10 +554,8 @@ render::ShapePipelinePointer GeometryCache::getShapePipeline(bool textured, bool · 2 unmodified lines | |||
| 554 | bool unlit, bool depthBias) { | 554 | bool unlit, bool depthBias) { |
| 555 | 555 | ||
| 556 | return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, false), nullptr, | 556 | return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, false), nullptr, |
| 557 | [](const render::ShapePipeline&, gpu::Batch& batch, render::Args*) { | 557 | [](const render::ShapePipeline& , gpu::Batch& batch, render::Args*) { |
| 558 | // Set the defaults needed for a simple program | 558 | batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get<TextureCache>()->getWhiteTexture()); |
| 559 | batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, | ||
| 560 | DependencyManager::get<TextureCache>()->getWhiteTexture()); | ||
| 561 | } | 559 | } |
| 562 | ); | 560 | ); |
| 563 | } | 561 | } |
| @@ -568,11 +566,9 @@ render::ShapePipelinePointer GeometryCache::getFadingShapePipeline(bool textured · 4 unmodified lines | |||
| 568 | auto fadeBatchSetter = fadeEffect->getBatchSetter(); | 566 | auto fadeBatchSetter = fadeEffect->getBatchSetter(); |
| 569 | auto fadeItemSetter = fadeEffect->getItemSetter(); | 567 | auto fadeItemSetter = fadeEffect->getItemSetter(); |
| 570 | return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, true), nullptr, | 568 | return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, true), nullptr, |
| 571 | [fadeBatchSetter, fadeItemSetter](const render::ShapePipeline& pipeline, gpu::Batch& batch, render::Args* args) { | 569 | [fadeBatchSetter, fadeItemSetter](const render::ShapePipeline& shapePipeline, gpu::Batch& batch, render::Args* args) { |
| 572 | // Set the defaults needed for a simple program | 570 | batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get<TextureCache>()->getWhiteTexture()); |
| 573 | batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, | 571 | fadeBatchSetter(shapePipeline, batch, args); |
| 574 | DependencyManager::get<TextureCache>()->getWhiteTexture()); | ||
| 575 | fadeBatchSetter(pipeline, batch, args); | ||
| 576 | }, | 572 | }, |
| 577 | fadeItemSetter | 573 | fadeItemSetter |
| 578 | ); | 574 | ); |
| @@ -1970,6 +1966,7 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp · 1391 unmodified lines | |||
| 1970 | _unlitShader = gpu::Shader::createProgram(VS, PSUnlit); | 1966 | _unlitShader = gpu::Shader::createProgram(VS, PSUnlit); |
| 1971 | 1967 | ||
| 1972 | gpu::Shader::BindingSet slotBindings; | 1968 | gpu::Shader::BindingSet slotBindings; |
| 1969 | slotBindings.insert(gpu::Shader::Binding(std::string("originalTexture"), render::ShapePipeline::Slot::MAP::ALBEDO)); | ||
| 1973 | gpu::Shader::makeProgram(*_simpleShader, slotBindings); | 1970 | gpu::Shader::makeProgram(*_simpleShader, slotBindings); |
| 1974 | gpu::Shader::makeProgram(*_unlitShader, slotBindings); | 1971 | gpu::Shader::makeProgram(*_unlitShader, slotBindings); |
| 1975 | }); | 1972 | }); |
| @@ -1984,6 +1981,8 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp · 8 unmodified lines | |||
| 1984 | _unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit); | 1981 | _unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit); |
| 1985 | 1982 | ||
| 1986 | gpu::Shader::BindingSet slotBindings; | 1983 | gpu::Shader::BindingSet slotBindings; |
| 1984 | slotBindings.insert(gpu::Shader::Binding(std::string("originalTexture"), render::ShapePipeline::Slot::MAP::ALBEDO)); | ||
| 1985 | slotBindings.insert(gpu::Shader::Binding(std::string("fadeMaskMap"), render::ShapePipeline::Slot::MAP::FADE_MASK)); | ||
| 1987 | gpu::Shader::makeProgram(*_simpleFadeShader, slotBindings); | 1986 | gpu::Shader::makeProgram(*_simpleFadeShader, slotBindings); |
| 1988 | gpu::Shader::makeProgram(*_unlitFadeShader, slotBindings); | 1987 | gpu::Shader::makeProgram(*_unlitFadeShader, slotBindings); |
| 1989 | }); | 1988 | }); |