MadDeCoDeR / Classic-RBDOOM-3-BFG

DOOM: BFA (Big Freaking Anniversary) Edition (former Classic RBDoom 3 BFG) is a source port based on RBDOOM-3-BFG and enchance the experience of Ultimate DOOM, DOOM 2 and DOOM 3.
GNU General Public License v3.0
211 stars 22 forks source link

Disable twosided key for player head to enable shadow volume cast #137

Closed mmillar-bolis closed 9 months ago

mmillar-bolis commented 9 months ago

Describe the Bug: The main Doom 3 campaign has a problem when g_showplayershadow is on: the player's head does not cast a shadow. This issue is present in vanilla Doom 3 BFG as well. This can be fixed by changing materials/characters.mtr and commenting out the shader keyword twosided on line 2483:

models/characters/player/playerhead
{
        noselfShadow
    noOverlays
    flesh
    clamp
    //twosided

    renderbump  -size 512 512 -trace 0.07 -colorMap -aa 2  models/characters/player/playerhead_512_local.tga models/characters/player/playerhead_hi.lwo

According to posts online, twosided apparently not only draws a texture on both sides of the mesh, but also disables it's shadow volume cast, leading to the issue we see with the head. Other meshes use this keyword for hair and glasses, but no other part of the player body does. The Resurrection of Evil and Lost Episode player models do not exhibit this issue either.

Screenshots:

screenshot001 Screenshot 1 - Default rendering of player using twosided shader key on head, resulting in headless shadow. ​

screenshot002 Screenshot 2 - Fixed rendering of player by removing twosided shader key from head, resulting in normal shadow. ​

Desktop:

mmillar-bolis commented 9 months ago

Excellent, thank you so much!

MadDeCoDeR commented 9 months ago

I just re-run the merge action after I updated the repo with the asset files. Sadly vcpkg decided to re-compile ffmpeg so in an hour from now the new prebuilds should be ready