FirstPersonModel icon indicating copy to clipboard operation
FirstPersonModel copied to clipboard

Compatibility problem with shader shadows

Open SKWID011 opened this issue 1 year ago • 10 comments

Shadows from shaders do not work right with this mod.

Minecraft Version: Forge 1.16.5-36.2.42

Version of FirstPersonModel: 2.4.4

Shaders Tested: ComplementaryUnbound_r5.2.2, Body Camera Shader - V1.2.1, Aurora's Shaders, BSL_v8.2.09.

Mod Used to Enable Shaders: oculus-mc1.16.5-1.4.7-DH-support (Tried oculus-mc1.16.5-1.4.8 and got same effect)

Issue: Player shadows overlay over the first person model. Even facing the sun, the front of the model is still shrouded in shadows.

https://github.com/user-attachments/assets/b5883f01-9c53-41b0-a151-91183a297677

SKWID011 avatar Aug 06 '24 19:08 SKWID011

Uhhh not sure, probably won't look into Oculus issues, as it's an unofficial port of Sodium that introduces new bugs. (+ 1.16, why is there an Oculus version for 1.16?)

tr7zw avatar Aug 06 '24 19:08 tr7zw

Uhhh not sure, probably won't look into Oculus issues, as it's an unofficial port of Sodium that introduces new bugs. (+ 1.16, why is there an Oculus version for 1.16?)

There is a version of Sodium for 1.16.5 that they used for the Oculus port iirc. Does this problem not come up with Sodium?

SKWID011 avatar Aug 06 '24 20:08 SKWID011

Havent heard of that issue so far, and the 1.16 version is like 3 years old I think, so more buggy and less performant in general.

tr7zw avatar Aug 06 '24 20:08 tr7zw

Havent heard of that issue so far, and the 1.16 version is like 3 years old I think, so more buggy and less performant in general.

It happens in 1.21 Fabric with the newest versions of Sodium and Iris. Maybe its just my PC lol. Would like to see if anyone else is having this problem.

2024-08-06_16 25 00 2024-08-06_16 25 04

SKWID011 avatar Aug 06 '24 21:08 SKWID011

Hm then I guess no one ever noticed that. Main issue is that there is nothing I can do about that, as the mod has 0 lines related to how Iris shaders work. Maybe its related to the weird mc behavior that 360° has each face in light twice, which makes no sense? (without shaders)

tr7zw avatar Aug 06 '24 22:08 tr7zw

The problem comes down to shadows being rendered differently for first and third person. In first person, the shadows are rendered a little in front of the actual model. This seems to be what causes the problem. The third person views the shadows do not cause this problem. So I ask. How possible would it be to move the camera position for the F5 view to the same location as the first person one? If possible you could set it as a "shader compatibility mode" setting that over rights the F5 camera location.

SKWID011 avatar Aug 06 '24 23:08 SKWID011

UHHHHHHHH I kinda dont want to touch the camera at all, but this would just modify the "maximum camera distance" of f5 and set it to 0. I have no clue what kind of effects/side effects that could cause? Pretty sure some mods like Shoulder surfing or better f5 will not be ok with that(being in "first person", but faking f5, but also not having the camera moved and the player moved instead?). This will take some time to when I have the time to investigate this.

tr7zw avatar Aug 07 '24 14:08 tr7zw

(It might be better to have a hook into Iris and just tell it "its always third person")

tr7zw avatar Aug 07 '24 14:08 tr7zw

UHHHHHHHH I kinda dont want to touch the camera at all, but this would just modify the "maximum camera distance" of f5 and set it to 0. I have no clue what kind of effects/side effects that could cause? Pretty sure some mods like Shoulder surfing or better f5 will not be ok with that(being in "first person", but faking f5, but also not having the camera moved and the player moved instead?). This will take some time to when I have the time to investigate this.

Actually looks like setting the player x position all the way forwards in the settings for this mod lines up the model with the shadow. The camera still needs to be moved to line up with the model, Idk if moving the camera would in turn move the shadow?

SKWID011 avatar Aug 08 '24 14:08 SKWID011

Hi!! I'm no developer but the problem seems to me that the shadows cast from the player originate from the shader's invisible player model (or maybe it's just the third person player model invisible) , and the first person player model doesnt cast shadows at all? Moving the player model and camera forward is obviously a terrible solution, but if it could be done that, while in first person, the first person player model would cast shadows instead of the standard shader one, this would be solved. I think.

Sprillet avatar Mar 03 '25 07:03 Sprillet