mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Adds r_pr_shadowfiltering and r_pr_atiworkaround cvars.
git-svn-id: https://svn.eduke32.com/eduke32@1408 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
f46e3b44f4
commit
0688522507
4 changed files with 19 additions and 10 deletions
|
@ -36,6 +36,7 @@ extern int32_t pr_specularmapping;
|
|||
extern int32_t pr_shadows;
|
||||
extern int32_t pr_shadowcount;
|
||||
extern int32_t pr_shadowdetail;
|
||||
extern int32_t pr_shadowfiltering;
|
||||
extern int32_t pr_maxlightpasses;
|
||||
extern int32_t pr_maxlightpriority;
|
||||
extern int32_t pr_fov;
|
||||
|
@ -50,6 +51,7 @@ extern float pr_parallaxbias;
|
|||
extern int32_t pr_overridespecular;
|
||||
extern float pr_specularpower;
|
||||
extern float pr_specularfactor;
|
||||
extern int32_t pr_atiworkaround;
|
||||
|
||||
// MATERIAL
|
||||
typedef enum {
|
||||
|
|
|
@ -7569,6 +7569,7 @@ int32_t loadmaphack(char *filename)
|
|||
scriptfile_getnumber(script, &value);
|
||||
light.tilenum = value;
|
||||
|
||||
if (rendmode == 4)
|
||||
polymer_addlight(&light);
|
||||
|
||||
break;
|
||||
|
|
|
@ -12,6 +12,7 @@ int32_t pr_specularmapping = 1;
|
|||
int32_t pr_shadows = 1;
|
||||
int32_t pr_shadowcount = 5;
|
||||
int32_t pr_shadowdetail = 4;
|
||||
int32_t pr_shadowfiltering = 1;
|
||||
int32_t pr_maxlightpasses = 5;
|
||||
int32_t pr_maxlightpriority = PR_MAXLIGHTPRIORITY;
|
||||
int32_t pr_fov = 426; // appears to be the classic setting.
|
||||
|
@ -26,6 +27,7 @@ float pr_parallaxbias = 0.0f;
|
|||
int32_t pr_overridespecular = 0;
|
||||
float pr_specularpower = 15.0f;
|
||||
float pr_specularfactor = 1.0f;
|
||||
int32_t pr_atiworkaround = 0;
|
||||
|
||||
GLenum mapvbousage = GL_STREAM_DRAW_ARB;
|
||||
GLenum modelvbousage = GL_STATIC_DRAW_ARB;
|
||||
|
@ -4640,6 +4642,7 @@ static void polymer_initrendertargets(int32_t count)
|
|||
prrts[i].ydim = 128 << pr_shadowdetail;
|
||||
prrts[i].color = 0;
|
||||
|
||||
if (pr_atiworkaround) {
|
||||
bglGenTextures(1, &prrts[i].color);
|
||||
bglBindTexture(prrts[i].target, prrts[i].color);
|
||||
|
||||
|
@ -4649,13 +4652,14 @@ static void polymer_initrendertargets(int32_t count)
|
|||
bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
}
|
||||
}
|
||||
|
||||
bglGenTextures(1, &prrts[i].z);
|
||||
bglBindTexture(prrts[i].target, prrts[i].z);
|
||||
|
||||
bglTexImage2D(prrts[i].target, 0, GL_DEPTH_COMPONENT, prrts[i].xdim, prrts[i].ydim, 0, GL_DEPTH_COMPONENT, GL_SHORT, NULL);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_MIN_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_MAG_FILTER, pr_shadowfiltering ? GL_LINEAR : GL_NEAREST);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_S, GL_CLAMP);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_WRAP_T, GL_CLAMP);
|
||||
bglTexParameteri(prrts[i].target, GL_TEXTURE_COMPARE_MODE_ARB, GL_COMPARE_R_TO_TEXTURE_ARB);
|
||||
|
|
|
@ -5980,6 +5980,7 @@ void polymost_initosdfuncs(void)
|
|||
{ "r_pr_shadows", "r_pr_shadows: enable/disable dynamic shadows", (void*)&pr_shadows, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_pr_shadowcount", "r_pr_shadowcount: maximal amount of shadow emitting lights on screen - you need to restart the renderer for it to take effect", (void*)&pr_shadowcount, CVAR_INT, 0, 0, 64 },
|
||||
{ "r_pr_shadowdetail", "r_pr_shadowdetail: sets the shadow map resolution - you need to restart the renderer for it to take effect", (void*)&pr_shadowdetail, CVAR_INT, 0, 0, 5 },
|
||||
{ "r_pr_shadowfiltering", "r_pr_shadowfiltering: enable/disable shadow edges filtering - you need to restart the renderer for it to take effect", (void*)&pr_shadowfiltering, CVAR_BOOL, 0, 0, 1 },
|
||||
{ "r_pr_maxlightpasses", "r_pr_maxlightpasses: the maximal amount of lights a single object can by affected by", (void*)&pr_maxlightpasses, CVAR_INT, 0, 0, 512 },
|
||||
{ "r_pr_maxlightpriority", "r_pr_maxlightpriority: lowering that value removes less meaningful lights from the scene", (void*)&pr_maxlightpriority, CVAR_INT, 0, 0, PR_MAXLIGHTPRIORITY },
|
||||
{ "r_pr_fov", "r_pr_fov: sets the field of vision in build angle", (void*)&pr_fov, CVAR_INT, 0, 0, 1023},
|
||||
|
@ -5994,6 +5995,7 @@ void polymost_initosdfuncs(void)
|
|||
{ "r_pr_overridespecular", "r_pr_overridespecular: overrides specular material power and factor values with values from the pr_specularpower and pr_specularfactor cvars; use it to fine-tune DEF tokens", (void*)&pr_overridespecular, CVAR_BOOL | CVAR_NOSAVE, 0, 0, 1 },
|
||||
{ "r_pr_specularpower", "r_pr_specularpower: overriden specular material power", (void*)&pr_specularpower, CVAR_FLOAT | CVAR_NOSAVE, 0, -10, 1000 },
|
||||
{ "r_pr_specularfactor", "r_pr_specularfactor: overriden specular material factor", (void*)&pr_specularfactor, CVAR_FLOAT | CVAR_NOSAVE, 0, -10, 1000 },
|
||||
{ "r_pr_atiworkaround", "r_pr_atiworkaround: enable this to workaround an ATI driver bug that causes sprite shadows to be square - you need to restart the renderer for it to take effect", (void*)&pr_atiworkaround, CVAR_BOOL, 0, 0, 1 },
|
||||
#endif
|
||||
|
||||
{ "r_models","r_models: enable/disable model rendering in >8-bit mode",(void *)&usemodels, CVAR_BOOL, 0, 0, 1 },
|
||||
|
|
Loading…
Reference in a new issue