Skip to content

Commit

Permalink
RealRTCW: allow shadow when model in fog
Browse files Browse the repository at this point in the history
  • Loading branch information
glKarin committed Nov 6, 2024
1 parent 7b4b0c0 commit 330503f
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doom3_windows_x64_msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ on:
push:
branches: [ "master" ]
paths:
- 'Q3E/src/main/jni/doom3/neo/**'
#- 'Q3E/src/main/jni/doom3/neo/**'
- '.github/workflows/doom3_windows_x64_msvc.yml'
pull_request:
branches: [ "master" ]
paths:
- 'Q3E/src/main/jni/doom3/neo/**'
#- 'Q3E/src/main/jni/doom3/neo/**'
- '.github/workflows/doom3_windows_x64_msvc.yml'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Q3E/src/main/jni/doom3/neo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ else() #TODO linux
if(SDL2_FOUND)
set(LINUX_SDL TRUE)
message(STATUS "use SDL2")
include_directories(${SDL2_INCLUDE_DIR})
include_directories(${SDL2_INCLUDE_DIRS})
set(SDLx_LIBRARY ${SDL2_LIBRARIES})
add_definitions(-D_SDL)
set(sys_libs ${sys_libs} ${SDLx_LIBRARY})
Expand Down
2 changes: 1 addition & 1 deletion Q3E/src/main/jni/etw/src/rendererGLES/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1166,10 +1166,10 @@ void R_Register(void)
harm_r_stencilShadowPersonal = ri.Cvar_Get("harm_r_stencilShadowPersonal", "1", CVAR_ARCHIVE); // 1=always render player model shadow; 2=render player model shadow(by harm_r_stencilShadowModel); 0=
harm_r_stencilShadowMaxAngle = ri.Cvar_Get("harm_r_stencilShadowMaxAngle", "-1", CVAR_ARCHIVE); // if( dot( lightDir, vec3(0, 0, 1) ) > cos(DEG2RAD(harm_r_stencilShadowMaxAngle)) ) render stencil shadow. e.g. <0=allow all angle; 0=disable all; 180=allow all; 90=only when light direction is down
harm_r_stencilShadowModel = ri.Cvar_Get("harm_r_stencilShadowModel", "3", CVAR_ARCHIVE); // model type mask=1 2 4 8; 0=all model
harm_r_stencilShadowOp = ri.Cvar_Get("harm_r_stencilShadowOp", "0", CVAR_ARCHIVE); // 1=z-pass; 2=z-fail; 0=auto(personal: z-fail)

harm_r_stencilShadowMask = ri.Cvar_Get("harm_r_stencilShadowMask", "0", STENCIL_SHADOW_CVAR_FLAG); // 1=render mask every render shadow volume; 0=render mask after all surfaces render
harm_r_stencilShadowDebug = ri.Cvar_Get("harm_r_stencilShadowDebug", "0", 0); // debug stencil shadow: 1=render edges; 2=render front cap; 4=render far cap
harm_r_stencilShadowOp = ri.Cvar_Get("harm_r_stencilShadowOp", "0", STENCIL_SHADOW_CVAR_FLAG); // 1=z-pass; 2=z-fail; 0=auto(personal: z-fail)
harm_r_stencilShadowCap = ri.Cvar_Get("harm_r_stencilShadowCap", "1", STENCIL_SHADOW_CVAR_FLAG); // 1=render shadow volume's caps(near cap: back facing light source; far cap: back facing light source); 2=render shadow volume's caps(near cap: facing light source; far cap: back facing light source); 3=render shadow volume's caps(near cap: facing light source; far cap: facing light source); 0=don't render shadow volume's caps exclude personal(personal is same as 1)
harm_r_stencilShadowInfinite = ri.Cvar_Get("harm_r_stencilShadowInfinite", "0", STENCIL_SHADOW_CVAR_FLAG); // <0=edge's far.w = 0.0 and use 4-components(xyzw); >=0=use 3-components(xyz). 0: 512, |length|

Expand Down
4 changes: 4 additions & 0 deletions Q3E/src/main/jni/realrtcw/code/renderer/tr_animation.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,9 @@ void R_AddAnimSurfaces( trRefEntity_t *ent ) {
!personalModel
#endif
&& r_shadows->integer == 2
#if !defined(STENCIL_SHADOW_IMPROVE) //karin: allow shadow on fog
&& fogNum == 0
#endif
&& !(ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
&& shader->sort == SS_OPAQUE
#ifdef STENCIL_SHADOW_IMPROVE //karin: ignore alpha test shader pass and special model type exclude player model
Expand Down Expand Up @@ -1642,7 +1644,9 @@ void R_MDRAddAnimSurfaces( trRefEntity_t *ent ) {
!personalModel
#endif
&& r_shadows->integer == 2
#if !defined(STENCIL_SHADOW_IMPROVE) //karin: allow shadow on fog
&& fogNum == 0
#endif
&& !(ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
&& shader->sort == SS_OPAQUE
#ifdef STENCIL_SHADOW_IMPROVE //karin: ignore alpha test shader pass and special model type exclude player model
Expand Down
2 changes: 2 additions & 0 deletions Q3E/src/main/jni/realrtcw/code/renderer/tr_cmesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,9 @@ void R_AddMDCSurfaces( trRefEntity_t *ent ) {
!personalModel
#endif
&& r_shadows->integer == 2
#if !defined(STENCIL_SHADOW_IMPROVE) //karin: allow shadow on fog
&& fogNum == 0
#endif
&& !( ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
&& shader->sort == SS_OPAQUE
#ifdef STENCIL_SHADOW_IMPROVE //karin: ignore alpha test shader pass and special model type exclude player model
Expand Down
6 changes: 3 additions & 3 deletions Q3E/src/main/jni/realrtcw/code/renderer/tr_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1403,11 +1403,11 @@ void R_Register( void ) {
#endif
harm_r_stencilShadowPersonal = ri.Cvar_Get("harm_r_stencilShadowPersonal", "1", CVAR_ARCHIVE); // 1=always render player model shadow; 2=render player model shadow(by harm_r_stencilShadowModel); 0=
harm_r_stencilShadowMaxAngle = ri.Cvar_Get("harm_r_stencilShadowMaxAngle", "-1", CVAR_ARCHIVE); // if( dot( lightDir, vec3(0, 0, 1) ) > cos(DEG2RAD(harm_r_stencilShadowMaxAngle)) ) render stencil shadow. e.g. <0=allow all angle; 0=disable all; 180=allow all; 90=only when light direction is down
harm_r_stencilShadowMask = ri.Cvar_Get("harm_r_stencilShadowMask", "0", STENCIL_SHADOW_CVAR_FLAG); // 1=render mask every render shadow volume; 0=render mask after all surfaces render
harm_r_stencilShadowModel = ri.Cvar_Get("harm_r_stencilShadowModel", "3", CVAR_ARCHIVE); // model type mask=1 2 4 8 16; 0=all model
harm_r_stencilShadowOp = ri.Cvar_Get("harm_r_stencilShadowOp", "0", CVAR_ARCHIVE); // 1=z-pass; 2=z-fail; 0=auto(personal: z-fail)

harm_r_stencilShadowMask = ri.Cvar_Get("harm_r_stencilShadowMask", "0", STENCIL_SHADOW_CVAR_FLAG); // 1=render mask every render shadow volume; 0=render mask after all surfaces render
harm_r_stencilShadowDebug = ri.Cvar_Get("harm_r_stencilShadowDebug", "0", 0); // debug stencil shadow: 1=render edges; 2=render front cap; 4=render far cap
harm_r_stencilShadowModel = ri.Cvar_Get("harm_r_stencilShadowModel", "3", STENCIL_SHADOW_CVAR_FLAG); // model type mask=1 2 4 8 16; 0=all model
harm_r_stencilShadowOp = ri.Cvar_Get("harm_r_stencilShadowOp", "0", STENCIL_SHADOW_CVAR_FLAG); // 1=z-pass; 2=z-fail; 0=auto(personal: z-fail)
harm_r_stencilShadowCap = ri.Cvar_Get("harm_r_stencilShadowCap", "1", STENCIL_SHADOW_CVAR_FLAG); // 1=render shadow volume's caps(near cap: back facing light source; far cap: back facing light source); 2=render shadow volume's caps(near cap: facing light source; far cap: back facing light source); 3=render shadow volume's caps(near cap: facing light source; far cap: facing light source); 0=don't render shadow volume's caps exclude personal(personal is same as 1)

harm_r_shadowPolygonOffset = ri.Cvar_Get("harm_r_shadowPolygonOffset", "0", STENCIL_SHADOW_CVAR_FLAG); // render shadow volume's polygon offset units: DOOM3 default is -1
Expand Down
2 changes: 2 additions & 0 deletions Q3E/src/main/jni/realrtcw/code/renderer/tr_mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,9 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
!personalModel
#endif
&& r_shadows->integer == 2
#if !defined(STENCIL_SHADOW_IMPROVE) //karin: allow shadow on fog
&& fogNum == 0
#endif
&& !( ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
&& shader->sort == SS_OPAQUE
#ifdef STENCIL_SHADOW_IMPROVE //karin: ignore alpha test shader pass and special model type exclude player model
Expand Down
2 changes: 2 additions & 0 deletions Q3E/src/main/jni/realrtcw/code/renderer/tr_model_iqm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,9 @@ void R_AddIQMSurfaces( trRefEntity_t *ent ) {
!personalModel
#endif
&& r_shadows->integer == 2
#if !defined(STENCIL_SHADOW_IMPROVE) //karin: allow shadow on fog
&& fogNum == 0
#endif
&& !(ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
&& shader->sort == SS_OPAQUE
#ifdef STENCIL_SHADOW_IMPROVE //karin: ignore alpha test shader pass and special model type exclude player model
Expand Down

0 comments on commit 330503f

Please sign in to comment.