Commit 386f492f authored by Christopher Tenter's avatar Christopher Tenter
Browse files

fix per-face + unlit texturing with shaders

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17486 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 6d1a3ef9
......@@ -1054,7 +1054,10 @@ void ShaderProgGenerator::addFragmentBeginCode(QStringList* _code)
if (desc_.textureTypes().size() > 1 && desc_.normalizeTexColors)
_code->push_back("sg_cTex = sg_cTex * 1.0/" + QString::number(desc_.textureTypes().size()) +".0 ;");
_code->push_back("sg_cColor *= sg_cTex;");
if (desc_.shadeMode == SG_SHADE_UNLIT)
_code->push_back("sg_cColor += sg_cTex;");
else
_code->push_back("sg_cColor *= sg_cTex;");
}
......
......@@ -647,8 +647,8 @@ void initializeDefaultDrawModes( void )
SOLID_FACES_COLORED_FLAT_SHADED. setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_SMOOTH, NORMAL_PER_FACE, COLOR_PER_FACE));
SOLID_FACES_COLORED_SMOOTH_SHADED.setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_SMOOTH, NORMAL_PER_VERTEX, COLOR_PER_FACE));
SOLID_2DTEXTURED_FACE. setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_UNLIT, NORMAL_NONE, COLOR_NONE, TEXCOORD_PER_VERTEX));
SOLID_2DTEXTURED_FACE_SHADED.setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_SMOOTH, NORMAL_PER_FACE, COLOR_NONE, TEXCOORD_PER_VERTEX));
SOLID_2DTEXTURED_FACE. setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_UNLIT, NORMAL_NONE, COLOR_NONE, TEXCOORD_PER_HALFEDGE));
SOLID_2DTEXTURED_FACE_SHADED.setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_SMOOTH, NORMAL_PER_FACE, COLOR_NONE, TEXCOORD_PER_HALFEDGE));
SOLID_SMOOTH_SHADED_FEATURES.setDrawModeProperties(DrawModeProperties(PRIMITIVE_POLYGON, LIGHTSTAGE_SMOOTH, NORMAL_PER_HALFEDGE));
......
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