Commit 0a2a0847 authored by Christopher Tenter's avatar Christopher Tenter

ClassicDepthPeeling: use alpha channel of diffuse color refs #1377

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@16164 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 0b72c86c
...@@ -530,7 +530,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad ...@@ -530,7 +530,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad
" ", " ",
" VPosVS = (gl_PositionIn[0] + gl_PositionIn[1] + gl_PositionIn[2]) / 3.0;", " VPosVS = (gl_PositionIn[0] + gl_PositionIn[1] + gl_PositionIn[2]) / 3.0;",
" VPosVS = gl_ModelViewMatrix * VPosVS; // triangle center in view space needed for point and spot lights", " VPosVS = gl_ModelViewMatrix * VPosVS; // triangle center in view space needed for point and spot lights",
" vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.ambient.a);", " vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.diffuse.a);",
""}; ""};
const char* szGeometryShaderEnd[] = { const char* szGeometryShaderEnd[] = {
...@@ -636,7 +636,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad ...@@ -636,7 +636,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad
if (!_phong && !_flatShaded && !_wireFrame) if (!_phong && !_flatShaded && !_wireFrame)
{ {
// lighting code: // lighting code:
_strVertexShaderOut->push_back("\nvec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.ambient.a);"); _strVertexShaderOut->push_back("\nvec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.diffuse.a);");
_strVertexShaderOut->push_back("\nvec3 normal = vNormal;\n"); _strVertexShaderOut->push_back("\nvec3 normal = vNormal;\n");
std::string::size_type curPos = 0; std::string::size_type curPos = 0;
...@@ -692,13 +692,13 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad ...@@ -692,13 +692,13 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad
{ {
_strFragmentShaderOut->push_back(" vec3 normal = normalize(vNormal);\n"); _strFragmentShaderOut->push_back(" vec3 normal = normalize(vNormal);\n");
// _strFragmentShaderOut->push_back(" vec3 normal = normalize(cross(dFdx(vPosVS.xyz), dFdy(vPosVS.xyz)));\n"); // _strFragmentShaderOut->push_back(" vec3 normal = normalize(cross(dFdx(vPosVS.xyz), dFdy(vPosVS.xyz)));\n");
_strFragmentShaderOut->push_back(" vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.ambient.a);\n"); _strFragmentShaderOut->push_back(" vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.diffuse.a);\n");
if (_textured) if (_textured)
_strFragmentShaderOut->push_back(" vec4 diffColor = texture2D(DiffuseTex, vTexCoord); color.a *= diffColor.a;\n"); _strFragmentShaderOut->push_back(" vec4 diffColor = texture2D(DiffuseTex, vTexCoord); color.a *= diffColor.a;\n");
} }
else else
{ {
_strFragmentShaderOut->push_back(" vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.ambient.a);\n"); _strFragmentShaderOut->push_back(" vec4 color = vec4(gl_FrontMaterial.emission.rgb, gl_FrontMaterial.diffuse.a);\n");
_strFragmentShaderOut->push_back(" vec4 vColor = VColor;\n"); _strFragmentShaderOut->push_back(" vec4 vColor = VColor;\n");
if (_textured) if (_textured)
_strFragmentShaderOut->push_back(" vec4 diffColor = texture2D(DiffuseTex, VTexCoord); color.a *= diffColor.a;\n"); _strFragmentShaderOut->push_back(" vec4 diffColor = texture2D(DiffuseTex, VTexCoord); color.a *= diffColor.a;\n");
...@@ -725,7 +725,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad ...@@ -725,7 +725,7 @@ void DepthPeelingPlugin::generatePeelingShaders(GLSL::StringList* _strVertexShad
} }
} }
else // wireframe: no shading necessary else // wireframe: no shading necessary
_strFragmentShaderOut->push_back(" vec4 color = vec4(1.0, 1.0, 1.0, gl_FrontMaterial.ambient.a);\n"); _strFragmentShaderOut->push_back(" vec4 color = vec4(1.0, 1.0, 1.0, gl_FrontMaterial.diffuse.a);\n");
for (unsigned int i = 0; i < sizeof(szFragmentShaderEnd) / sizeof(char*); ++i) for (unsigned int i = 0; i < sizeof(szFragmentShaderEnd) / sizeof(char*); ++i)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment