Commit 6d1a3ef9 authored by Christopher Tenter's avatar Christopher Tenter
Browse files

avoid crash for untextured objects

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17484 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 3162d7c6
......@@ -655,10 +655,13 @@ void ShaderProgGenerator::addVertexBeginCode(QStringList* _code)
_code->push_back("vec3 sg_vNormalVS = vec3(0.0, 1.0, 0.0);");
/// TODO Setup for multiple texture coordinates as input
if (desc_.textureTypes().begin()->second.type == GL_TEXTURE_3D) {
_code->push_back("vec3 sg_vTexCoord = vec3(0.0, 0.0, 0.0);");
} else {
_code->push_back("vec2 sg_vTexCoord = vec2(0.0, 0.0);");
if (desc_.textured())
{
if (desc_.textureTypes().begin()->second.type == GL_TEXTURE_3D) {
_code->push_back("vec3 sg_vTexCoord = vec3(0.0, 0.0, 0.0);");
} else {
_code->push_back("vec2 sg_vTexCoord = vec2(0.0, 0.0);");
}
}
_code->push_back("vec4 sg_cColor = vec4(g_cEmissive, ALPHA);");
......
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