History

Shape entities have the correct pipeline picked when fading is activated. Still need to support instanced rendering

Olivier Prat committed 9 years ago

Commit 1f14b6e1 parent f8b2ffe11 files · +40 −25Browse files

Showing the changes to libraries/render-utils/src/GeometryCache.cpp (1 of 11 files). Show all

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+10−11
@@ -544,8 +544,8 @@ void GeometryCache::initializeShapePipelines() { · 543 unmodified lines
544544 if (!_simpleOpaquePipeline) {
545545 _simpleOpaquePipeline = getShapePipeline(false, false, true, false);
546546 _simpleTransparentPipeline = getShapePipeline(false, true, true, false);
547− _simpleOpaqueFadePipeline = getFadingShapePipeline(false, false, true, false, false);
548− _simpleTransparentFadePipeline = getFadingShapePipeline(false, true, true, false, false);
547+ _simpleOpaqueFadePipeline = getFadingShapePipeline(false, false, false, false, false);
548+ _simpleTransparentFadePipeline = getFadingShapePipeline(false, true, false, false, false);
549549 _simpleWirePipeline = getShapePipeline(false, false, true, true);
550550 }
551551 }
@@ -554,10 +554,8 @@ render::ShapePipelinePointer GeometryCache::getShapePipeline(bool textured, bool · 2 unmodified lines
554554 bool unlit, bool depthBias) {
555555
556556 return std::make_shared<render::ShapePipeline>(getSimplePipeline(textured, transparent, culled, unlit, depthBias, false), nullptr,
557− [](const render::ShapePipeline&, gpu::Batch& batch, render::Args*) {
558− // Set the defaults needed for a simple program
559− batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO,
560− DependencyManager::get<TextureCache>()->getWhiteTexture());
557+ [](const render::ShapePipeline& , gpu::Batch& batch, render::Args*) {
558+ batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get<TextureCache>()->getWhiteTexture());
561559 }
562560 );
563561 }
@@ -568,11 +566,9 @@ render::ShapePipelinePointer GeometryCache::getFadingShapePipeline(bool textured · 4 unmodified lines
568566 auto fadeBatchSetter = fadeEffect->getBatchSetter();
569567 auto fadeItemSetter = fadeEffect->getItemSetter();
570568 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) {
572− // Set the defaults needed for a simple program
573− batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO,
574− DependencyManager::get<TextureCache>()->getWhiteTexture());
575− fadeBatchSetter(pipeline, batch, args);
569+ [fadeBatchSetter, fadeItemSetter](const render::ShapePipeline& shapePipeline, gpu::Batch& batch, render::Args* args) {
570+ batch.setResourceTexture(render::ShapePipeline::Slot::MAP::ALBEDO, DependencyManager::get<TextureCache>()->getWhiteTexture());
571+ fadeBatchSetter(shapePipeline, batch, args);
576572 },
577573 fadeItemSetter
578574 );
@@ -1970,6 +1966,7 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp · 1391 unmodified lines
19701966 _unlitShader = gpu::Shader::createProgram(VS, PSUnlit);
19711967
19721968 gpu::Shader::BindingSet slotBindings;
1969+ slotBindings.insert(gpu::Shader::Binding(std::string("originalTexture"), render::ShapePipeline::Slot::MAP::ALBEDO));
19731970 gpu::Shader::makeProgram(*_simpleShader, slotBindings);
19741971 gpu::Shader::makeProgram(*_unlitShader, slotBindings);
19751972 });
@@ -1984,6 +1981,8 @@ gpu::PipelinePointer GeometryCache::getSimplePipeline(bool textured, bool transp · 8 unmodified lines
19841981 _unlitFadeShader = gpu::Shader::createProgram(VS, PSUnlit);
19851982
19861983 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));
19871986 gpu::Shader::makeProgram(*_simpleFadeShader, slotBindings);
19881987 gpu::Shader::makeProgram(*_unlitFadeShader, slotBindings);
19891988 });

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t