From 6128911c8cf2728b7d8ad4b1ccfca02f5bceada0 Mon Sep 17 00:00:00 2001 From: Plagman Date: Wed, 8 May 2013 05:03:29 +0000 Subject: [PATCH] Fix interaction between ART mapping and lighting. git-svn-id: https://svn.eduke32.com/eduke32@3738 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/polymer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/polymer/eduke32/build/src/polymer.c b/polymer/eduke32/build/src/polymer.c index eaac7469f..fce871502 100644 --- a/polymer/eduke32/build/src/polymer.c +++ b/polymer/eduke32/build/src/polymer.c @@ -289,13 +289,18 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = { " float colorIndex = texture2D(artMap, commonTexCoord.st).r;\n" " float colorIndexNear = texture2D(lookupMap, vec2(colorIndex, floor(shadeLookup) / 32.0)).r;\n" " float colorIndexFar = texture2D(lookupMap, vec2(colorIndex, min(floor(shadeLookup + 1.0), 32.0) / 32.0)).r;\n" + " float colorIndexFullbright = texture2D(lookupMap, vec2(colorIndex, 0.0)).r;\n" "\n" " vec3 texelNear = texture2D(basePalMap, vec2(colorIndexNear, 0.5)).rgb;\n" " vec3 texelFar = texture2D(basePalMap, vec2(colorIndexFar, 0.5)).rgb;\n" - " diffuseTexel.rgb = mix(texelNear, texelFar, fract(shadeLookup)) * 4.0;\n" - " diffuseTexel.a = 1.0;\n" - " if (colorIndex == 1.0)\n" - " diffuseTexel.a = 0.0;\n" + " diffuseTexel.rgb = texture2D(basePalMap, vec2(colorIndexFullbright, 0.5)).rgb * 4.0;\n" + "\n" + " if (isLightingPass == 0) {\n" + " result.rgb = mix(texelNear, texelFar, fract(shadeLookup)) * 4.0;\n" + " result.a = 1.0;\n" + " if (colorIndex == 1.0)\n" + " result.a = 0.0;\n" + " }\n" "\n", }, { @@ -4767,7 +4772,6 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights, if (pr_artmapping && material.artmap && (overridematerial & prprogrambits[PR_BIT_ART_MAP].bit)) { programbits |= prprogrambits[PR_BIT_ART_MAP].bit; - programbits |= prprogrambits[PR_BIT_DIFFUSE_MAP2].bit; } else // PR_BIT_DIFFUSE_MAP if (material.diffusemap) {