History

REmove the crappy solution for drawing transparent texture into overlay by a proper shader

Sam Gateau committed 11 years ago

Commit 66cd17e1 parent 8421aaf6 files · +49 −8Browse files

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

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+9−3
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929 #include "standardTransformPNTC_vert.h"
3030 #include "standardDrawTexture_frag.h"
3131
32+#include "gpu/StandardShaderLib.h"
33+
3234 //#define WANT_DEBUG
3335
3436 const int GeometryCache::UNKNOWN_ID = -1;
@@ -1660,16 +1662,20 @@ void GeometryCache::useSimpleDrawPipeline(gpu::Batch& batch, bool noBlend) { · 1625 unmodified lines
16601662
16611663 auto state = std::make_shared<gpu::State>();
16621664
1665+
16631666 // enable decal blend
16641667 state->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
16651668
16661669 _standardDrawPipeline.reset(gpu::Pipeline::create(program, state));
16671670
1671+
16681672 auto stateNoBlend = std::make_shared<gpu::State>();
1669− stateNoBlend->setColorWriteMask(true, true, true, false);
1670− stateNoBlend->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
1673+ // stateNoBlend->setColorWriteMask(true, true, true, false);
1674+ // stateNoBlend->setBlendFunction(true, gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA);
16711675
1672− _standardDrawPipelineNoBlend.reset(gpu::Pipeline::create(program, stateNoBlend));
1676+ auto programNoBlend = gpu::ShaderPointer(gpu::Shader::createProgram(vs, gpu::StandardShaderLib::getDrawTextureOpaquePS()));
1677+ gpu::Shader::makeProgram((*programNoBlend));
1678+ _standardDrawPipelineNoBlend.reset(gpu::Pipeline::create(programNoBlend, stateNoBlend));
16731679 }
16741680 if (noBlend) {
16751681 batch.setPipeline(_standardDrawPipelineNoBlend);

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