mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-18 15:11:51 +00:00
Perform the highpal lookup after the diffuse modulation and detail to hit more range in the highpalookup map. This shuffles a fair bit of lighting model around, so I wouldn't be surprised if I broke something.
git-svn-id: https://svn.eduke32.com/eduke32@1757 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
e4d8e53a5a
commit
1ececc94ea
2 changed files with 40 additions and 40 deletions
|
@ -68,10 +68,10 @@ typedef enum {
|
|||
PR_BIT_LIGHTING_PASS,
|
||||
PR_BIT_NORMAL_MAP,
|
||||
PR_BIT_DIFFUSE_MAP,
|
||||
PR_BIT_HIGHPALOOKUP_MAP,
|
||||
PR_BIT_DIFFUSE_MAP2,
|
||||
PR_BIT_DIFFUSE_DETAIL_MAP,
|
||||
PR_BIT_DIFFUSE_MODULATION,
|
||||
PR_BIT_HIGHPALOOKUP_MAP,
|
||||
PR_BIT_DIFFUSE_MAP2,
|
||||
PR_BIT_SPECULAR_MAP,
|
||||
PR_BIT_SPECULAR_MATERIAL,
|
||||
PR_BIT_MIRROR_MAP,
|
||||
|
|
|
@ -259,6 +259,43 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = {
|
|||
" diffuseTexel = texture2D(diffuseMap, commonTexCoord.st);\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_DIFFUSE_DETAIL_MAP,
|
||||
// vert_def
|
||||
"uniform vec2 detailScale;\n"
|
||||
"varying vec2 fragDetailScale;\n"
|
||||
"\n",
|
||||
// vert_prog
|
||||
" fragDetailScale = detailScale;\n"
|
||||
" if (isNormalMapped == 0)\n"
|
||||
" gl_TexCoord[1] = vec4(detailScale, 1.0, 1.0) * gl_MultiTexCoord0;\n"
|
||||
"\n",
|
||||
// frag_def
|
||||
"uniform sampler2D detailMap;\n"
|
||||
"varying vec2 fragDetailScale;\n"
|
||||
"\n",
|
||||
// frag_prog
|
||||
" if (isNormalMapped == 0)\n"
|
||||
" diffuseTexel *= texture2D(detailMap, gl_TexCoord[1].st);\n"
|
||||
" else\n"
|
||||
" diffuseTexel *= texture2D(detailMap, commonTexCoord.st * fragDetailScale);\n"
|
||||
" diffuseTexel.rgb *= 2.0;\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_DIFFUSE_MODULATION,
|
||||
// vert_def
|
||||
"",
|
||||
// vert_prog
|
||||
" gl_FrontColor = gl_Color;\n"
|
||||
"\n",
|
||||
// frag_def
|
||||
"",
|
||||
// frag_prog
|
||||
" if (isLightingPass == 0)\n"
|
||||
" diffuseTexel *= vec4(gl_Color);\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_HIGHPALOOKUP_MAP,
|
||||
// vert_def
|
||||
|
@ -285,43 +322,6 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = {
|
|||
" result *= diffuseTexel;\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_DIFFUSE_DETAIL_MAP,
|
||||
// vert_def
|
||||
"uniform vec2 detailScale;\n"
|
||||
"varying vec2 fragDetailScale;\n"
|
||||
"\n",
|
||||
// vert_prog
|
||||
" fragDetailScale = detailScale;\n"
|
||||
" if (isNormalMapped == 0)\n"
|
||||
" gl_TexCoord[1] = vec4(detailScale, 1.0, 1.0) * gl_MultiTexCoord0;\n"
|
||||
"\n",
|
||||
// frag_def
|
||||
"uniform sampler2D detailMap;\n"
|
||||
"varying vec2 fragDetailScale;\n"
|
||||
"\n",
|
||||
// frag_prog
|
||||
" if (isNormalMapped == 0)\n"
|
||||
" result *= texture2D(detailMap, gl_TexCoord[1].st);\n"
|
||||
" else\n"
|
||||
" result *= texture2D(detailMap, commonTexCoord.st * fragDetailScale);\n"
|
||||
" result.rgb *= 2.0;\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_DIFFUSE_MODULATION,
|
||||
// vert_def
|
||||
"",
|
||||
// vert_prog
|
||||
" gl_FrontColor = gl_Color;\n"
|
||||
"\n",
|
||||
// frag_def
|
||||
"",
|
||||
// frag_prog
|
||||
" if (isLightingPass == 0)\n"
|
||||
" result *= vec4(gl_Color);\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_SPECULAR_MAP,
|
||||
// vert_def
|
||||
|
@ -4276,7 +4276,7 @@ static int32_t polymer_bindmaterial(_prmaterial material, int16_t* lights,
|
|||
programbits |= prprogrambits[PR_BIT_HIGHPALOOKUP_MAP].bit;
|
||||
|
||||
// PR_BIT_DIFFUSE_DETAIL_MAP
|
||||
if (!curlight && r_detailmapping && material.detailmap)
|
||||
if (r_detailmapping && material.detailmap)
|
||||
programbits |= prprogrambits[PR_BIT_DIFFUSE_DETAIL_MAP].bit;
|
||||
|
||||
// PR_BIT_DIFFUSE_MODULATION
|
||||
|
|
Loading…
Reference in a new issue