diff --git a/hecl/extern/boo b/hecl/extern/boo index 6c12cd0ce..758be7d76 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 6c12cd0ce83e23dcc90ebcb1f89e2feb30a16353 +Subproject commit 758be7d76cc6fac9fddab6c075dd6bd5f79c0ace diff --git a/hecl/include/hecl/Backend/ProgrammableCommon.hpp b/hecl/include/hecl/Backend/ProgrammableCommon.hpp index d5ea01d62..9dae1112e 100644 --- a/hecl/include/hecl/Backend/ProgrammableCommon.hpp +++ b/hecl/include/hecl/Backend/ProgrammableCommon.hpp @@ -72,11 +72,21 @@ private: return hecl::Format("sampling%u.a", samplingIdx); } - virtual std::string EmitColorRegUse(unsigned idx) const + virtual std::string EmitColorRegUseRaw(unsigned idx) const { return hecl::Format("colorReg%u", idx); } + virtual std::string EmitColorRegUseRGB(unsigned idx) const + { + return hecl::Format("colorReg%u.rgb", idx); + } + + virtual std::string EmitColorRegUseAlpha(unsigned idx) const + { + return hecl::Format("colorReg%u.a", idx); + } + std::string EmitLightingRaw() const { return std::string("lighting"); diff --git a/hecl/lib/Backend/GLSL.cpp b/hecl/lib/Backend/GLSL.cpp index 8b82782aa..771325e9b 100644 --- a/hecl/lib/Backend/GLSL.cpp +++ b/hecl/lib/Backend/GLSL.cpp @@ -195,12 +195,10 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest, if (lighting.m_source) lightingSrc = lighting.m_source; else - lightingSrc = "UBINDING2 uniform LightingUniform\n" - "{\n" - " vec4 colorReg0;\n" - " vec4 colorReg1;\n" - " vec4 colorReg2;\n" - "};\n"; + lightingSrc = "const vec4 colorReg0 = vec4(1.0);\n" + "const vec4 colorReg1 = vec4(1.0);\n" + "const vec4 colorReg2 = vec4(1.0);\n" + "\n"; std::string texMapDecl; for (unsigned i=0 ; i