tr7zw / FirstPersonModel

Enables the third person Model in firstperson
MIT License
131 stars 25 forks source link

Compatibility problem with shader shadows #486

Open SKWID011 opened 1 month ago

SKWID011 commented 1 month ago

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

tr7zw commented 1 month ago

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?)

SKWID011 commented 1 month ago

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?

tr7zw commented 1 month ago

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.

SKWID011 commented 1 month ago

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

tr7zw commented 1 month ago

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)

SKWID011 commented 1 month ago

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.

tr7zw commented 1 month ago

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 commented 1 month ago

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

SKWID011 commented 1 month ago

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?