mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 03:00:46 +00:00
Fix the lighting model so that lights don't get the modulated diffuse (defeats the purpose if they do, since you wouldn't be able to light a fully shaded room). That means the highpal lookup has to be performed twice now, once with the modulated diffuse to apply to the result and once with no modulation to make a diffuse that the lighting code can use. That means that lighting isn't 100% accurate with respect to the highpal result, but that's the best approach I could think of.
git-svn-id: https://svn.eduke32.com/eduke32@1773 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
4a2fd12f4b
commit
658c3b66f1
2 changed files with 17 additions and 15 deletions
|
@ -70,8 +70,8 @@ typedef enum {
|
|||
PR_BIT_DIFFUSE_MAP,
|
||||
PR_BIT_DIFFUSE_DETAIL_MAP,
|
||||
PR_BIT_DIFFUSE_MODULATION,
|
||||
PR_BIT_HIGHPALOOKUP_MAP,
|
||||
PR_BIT_DIFFUSE_MAP2,
|
||||
PR_BIT_HIGHPALOOKUP_MAP,
|
||||
PR_BIT_SPECULAR_MAP,
|
||||
PR_BIT_SPECULAR_MATERIAL,
|
||||
PR_BIT_MIRROR_MAP,
|
||||
|
|
|
@ -293,20 +293,7 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = {
|
|||
"",
|
||||
// frag_prog
|
||||
" if (isLightingPass == 0)\n"
|
||||
" diffuseTexel *= vec4(gl_Color);\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_HIGHPALOOKUP_MAP,
|
||||
// vert_def
|
||||
"",
|
||||
// vert_prog
|
||||
"",
|
||||
// frag_def
|
||||
"uniform sampler3D highPalookupMap;\n"
|
||||
"\n",
|
||||
// frag_prog
|
||||
" diffuseTexel.rgb = texture3D(highPalookupMap, diffuseTexel.rgb).rgb;\n"
|
||||
" result *= vec4(gl_Color);\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
|
@ -322,6 +309,21 @@ _prprogrambit prprogrambits[PR_BIT_COUNT] = {
|
|||
" result *= diffuseTexel;\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_HIGHPALOOKUP_MAP,
|
||||
// vert_def
|
||||
"",
|
||||
// vert_prog
|
||||
"",
|
||||
// frag_def
|
||||
"uniform sampler3D highPalookupMap;\n"
|
||||
"\n",
|
||||
// frag_prog
|
||||
" if (isLightingPass == 0)\n"
|
||||
" result.rgb = texture3D(highPalookupMap, result.rgb).rgb;\n"
|
||||
" diffuseTexel.rgb = texture3D(highPalookupMap, diffuseTexel.rgb).rgb;\n"
|
||||
"\n",
|
||||
},
|
||||
{
|
||||
1 << PR_BIT_SPECULAR_MAP,
|
||||
// vert_def
|
||||
|
|
Loading…
Reference in a new issue