mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-10 08:05:52 +00:00
Default colorRegs when lighting uniform not available
This commit is contained in:
parent
7e42581cf0
commit
b7143c7dca
@ -194,6 +194,13 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest,
|
|||||||
std::string lightingSrc;
|
std::string lightingSrc;
|
||||||
if (lighting.m_source)
|
if (lighting.m_source)
|
||||||
lightingSrc = lighting.m_source;
|
lightingSrc = lighting.m_source;
|
||||||
|
else
|
||||||
|
lightingSrc = "UBINDING2 uniform LightingUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 colorReg0;\n"
|
||||||
|
" vec4 colorReg1;\n"
|
||||||
|
" vec4 colorReg2;\n"
|
||||||
|
"};\n";
|
||||||
|
|
||||||
std::string texMapDecl;
|
std::string texMapDecl;
|
||||||
for (unsigned i=0 ; i<m_texMapEnd ; ++i)
|
for (unsigned i=0 ; i<m_texMapEnd ; ++i)
|
||||||
@ -242,6 +249,13 @@ std::string GLSL::makeFrag(const char* glslVer, bool alphaTest,
|
|||||||
std::string lightingSrc;
|
std::string lightingSrc;
|
||||||
if (lighting.m_source)
|
if (lighting.m_source)
|
||||||
lightingSrc = lighting.m_source;
|
lightingSrc = lighting.m_source;
|
||||||
|
else
|
||||||
|
lightingSrc = "UBINDING2 uniform LightingUniform\n"
|
||||||
|
"{\n"
|
||||||
|
" vec4 colorReg0;\n"
|
||||||
|
" vec4 colorReg1;\n"
|
||||||
|
" vec4 colorReg2;\n"
|
||||||
|
"};\n";
|
||||||
|
|
||||||
std::string postSrc;
|
std::string postSrc;
|
||||||
if (post.m_source)
|
if (post.m_source)
|
||||||
|
@ -185,6 +185,13 @@ std::string HLSL::makeFrag(bool alphaTest, const ShaderFunction& lighting) const
|
|||||||
std::string lightingSrc;
|
std::string lightingSrc;
|
||||||
if (lighting.m_source)
|
if (lighting.m_source)
|
||||||
lightingSrc = lighting.m_source;
|
lightingSrc = lighting.m_source;
|
||||||
|
else
|
||||||
|
lightingSrc = "cbuffer LightingUniform : register(b2)\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 colorReg0;\n"
|
||||||
|
" float4 colorReg1;\n"
|
||||||
|
" float4 colorReg2;\n"
|
||||||
|
"};\n";
|
||||||
|
|
||||||
std::string texMapDecl;
|
std::string texMapDecl;
|
||||||
if (m_texMapEnd)
|
if (m_texMapEnd)
|
||||||
@ -228,6 +235,13 @@ std::string HLSL::makeFrag(bool alphaTest, const ShaderFunction& lighting,
|
|||||||
std::string lightingSrc;
|
std::string lightingSrc;
|
||||||
if (lighting.m_source)
|
if (lighting.m_source)
|
||||||
lightingSrc = lighting.m_source;
|
lightingSrc = lighting.m_source;
|
||||||
|
else
|
||||||
|
lightingSrc = "cbuffer LightingUniform : register(b2)\n"
|
||||||
|
"{\n"
|
||||||
|
" float4 colorReg0;\n"
|
||||||
|
" float4 colorReg1;\n"
|
||||||
|
" float4 colorReg2;\n"
|
||||||
|
"};\n";
|
||||||
|
|
||||||
std::string postSrc;
|
std::string postSrc;
|
||||||
if (post.m_source)
|
if (post.m_source)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user