Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
129a63f9
Commit
129a63f9
authored
Feb 19, 2019
by
Martin Heistermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GL: respect alpha channel of vertex colors
parent
3c3f2507
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
2 deletions
+10
-2
libs_required/ACG/GL/ShaderGenerator.cc
libs_required/ACG/GL/ShaderGenerator.cc
+10
-2
No files found.
libs_required/ACG/GL/ShaderGenerator.cc
View file @
129a63f9
...
...
@@ -1182,7 +1182,11 @@ void ShaderProgGenerator::addVertexBeginCode(QStringList* _code)
_code
->
push_back
(
"vec3 sg_vNormalOS = vec3(0.0, 1.0, 0.0);"
);
if
(
desc_
.
vertexColors
&&
(
desc_
.
colorMaterialMode
==
GL_AMBIENT
||
desc_
.
colorMaterialMode
==
GL_AMBIENT_AND_DIFFUSE
))
_code
->
push_back
(
QString
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".xyz, SG_ALPHA);"
));
_code
->
push_back
(
QString
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".rgb, SG_ALPHA * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".a);"
));
else
_code
->
push_back
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * g_cAmbient, SG_ALPHA);"
);
...
...
@@ -1817,7 +1821,11 @@ void ShaderProgGenerator::addFragmentBeginCode(QStringList* _code)
if
(
desc_
.
vertexColors
&&
(
desc_
.
colorMaterialMode
==
GL_AMBIENT
||
desc_
.
colorMaterialMode
==
GL_AMBIENT_AND_DIFFUSE
))
_code
->
push_back
(
QString
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".xyz, SG_ALPHA);"
));
_code
->
push_back
(
QString
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".rgb, SG_ALPHA * "
)
+
ShaderGenerator
::
keywords
.
macro_inputVertexColor
+
QString
(
".a);"
));
else
_code
->
push_back
(
"vec4 sg_cColor = vec4(g_cEmissive + g_cLightModelAmbient * g_cAmbient, SG_ALPHA);"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment