History

Web Entities now render correctly as well

Anthony Thibault committed 10 years ago

Commit ea310bc1 parent be6e4015 files · +18 −18Browse files

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

Unified · Split

libraries/render-utils/src/GeometryCache.cpp+9−9
@@ -35,7 +35,7 @@ · 34 unmodified lines
35#include "simple_vert.h"35#include "simple_vert.h"
36#include "simple_textured_frag.h"36#include "simple_textured_frag.h"
37#include "simple_textured_unlit_frag.h"37#include "simple_textured_unlit_frag.h"
38#include "simple_srgb_textured_unlit_no_dst_alpha_frag.h"38#include "simple_srgb_textured_unlit_no_tex_alpha_frag.h"
39#include "glowLine_vert.h"39#include "glowLine_vert.h"
40#include "glowLine_geom.h"40#include "glowLine_geom.h"
41#include "glowLine_frag.h"41#include "glowLine_frag.h"
@@ -1749,25 +1749,25 @@ inline bool operator==(const SimpleProgramKey& a, const SimpleProgramKey& b) { · 1707 unmodified lines
1749 return a.getRaw() == b.getRaw();1749 return a.getRaw() == b.getRaw();
1750}1750}
1751 1751
1752void GeometryCache::bindSimpleSRGBTexturedUnlitNoDstAlphaProgram(gpu::Batch& batch) {1752void GeometryCache::bindSimpleSRGBTexturedUnlitNoTexAlphaProgram(gpu::Batch& batch) {
1753 batch.setPipeline(getSimpleSRGBTexturedUnlitNoDstAlphaPipeline());1753 batch.setPipeline(getSimpleSRGBTexturedUnlitNoTexAlphaPipeline());
1754 // Set a default normal map1754 // Set a default normal map
1755 batch.setResourceTexture(render::ShapePipeline::Slot::MAP::NORMAL_FITTING,1755 batch.setResourceTexture(render::ShapePipeline::Slot::MAP::NORMAL_FITTING,
1756 DependencyManager::get<TextureCache>()->getNormalFittingTexture());1756 DependencyManager::get<TextureCache>()->getNormalFittingTexture());
1757}1757}
1758 1758
1759gpu::PipelinePointer GeometryCache::getSimpleSRGBTexturedUnlitNoDstAlphaPipeline() {1759gpu::PipelinePointer GeometryCache::getSimpleSRGBTexturedUnlitNoTexAlphaPipeline() {
1760 // Compile the shaders, once1760 // Compile the shaders, once
1761 static std::once_flag once;1761 static std::once_flag once;
1762 std::call_once(once, [&]() {1762 std::call_once(once, [&]() {
1763 auto VS = gpu::Shader::createVertex(std::string(simple_vert));1763 auto VS = gpu::Shader::createVertex(std::string(simple_vert));
1764 auto PS = gpu::Shader::createPixel(std::string(simple_srgb_textured_unlit_no_dst_alpha_frag));1764 auto PS = gpu::Shader::createPixel(std::string(simple_srgb_textured_unlit_no_tex_alpha_frag));
1765 1765
1766 _simpleSRGBTexturedUnlitNoDstAlphaShader = gpu::Shader::createProgram(VS, PS);1766 _simpleSRGBTexturedUnlitNoTexAlphaShader = gpu::Shader::createProgram(VS, PS);
1767 1767
1768 gpu::Shader::BindingSet slotBindings;1768 gpu::Shader::BindingSet slotBindings;
1769 slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), render::ShapePipeline::Slot::MAP::NORMAL_FITTING));1769 slotBindings.insert(gpu::Shader::Binding(std::string("normalFittingMap"), render::ShapePipeline::Slot::MAP::NORMAL_FITTING));
1770 gpu::Shader::makeProgram(*_simpleSRGBTexturedUnlitNoDstAlphaShader, slotBindings);1770 gpu::Shader::makeProgram(*_simpleSRGBTexturedUnlitNoTexAlphaShader, slotBindings);
1771 auto state = std::make_shared<gpu::State>();1771 auto state = std::make_shared<gpu::State>();
1772 state->setCullMode(gpu::State::CULL_NONE);1772 state->setCullMode(gpu::State::CULL_NONE);
1773 state->setDepthTest(true, true, gpu::LESS_EQUAL);1773 state->setDepthTest(true, true, gpu::LESS_EQUAL);
@@ -1775,10 +1775,10 @@ gpu::PipelinePointer GeometryCache::getSimpleSRGBTexturedUnlitNoDstAlphaPipeline · 1 unmodified line
1775 gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,1775 gpu::State::SRC_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::INV_SRC_ALPHA,
1776 gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);1776 gpu::State::FACTOR_ALPHA, gpu::State::BLEND_OP_ADD, gpu::State::ONE);
1777 1777
1778 _simpleSRGBTexturedUnlitNoDstAlphaPipeline = gpu::Pipeline::create(_simpleSRGBTexturedUnlitNoDstAlphaShader, state);1778 _simpleSRGBTexturedUnlitNoTexAlphaPipeline = gpu::Pipeline::create(_simpleSRGBTexturedUnlitNoTexAlphaShader, state);
1779 });1779 });
1780 1780
1781 return _simpleSRGBTexturedUnlitNoDstAlphaPipeline;1781 return _simpleSRGBTexturedUnlitNoTexAlphaPipeline;
1782}1782}
1783 1783
1784void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool culled, bool unlit, bool depthBiased) {1784void GeometryCache::bindSimpleProgram(gpu::Batch& batch, bool textured, bool culled, bool unlit, bool depthBiased) {