mtasa-blue icon indicating copy to clipboard operation
mtasa-blue copied to clipboard

Dynamic ped shadows

Open lopezloo opened this issue 3 years ago • 4 comments

Is your feature request related to a problem? Please describe.

In MTA, peds (and players) are always using static shadows. In single player, it's based on visual quality option.

Describe the solution you'd like

Enable dynamic shadows for peds and players and add new checkbox in visual settings for that.

Describe alternatives you've considered

No response

Additional context

I requested this feature many years ago at bugs.mtasa.com and it was rejected but to be honest I still don't quite understand why. I think it's possible to implement it.

Security Policy

  • [X] I have read and understood the Security Policy and this issue is not about a cheat or security vulnerability.

lopezloo avatar Sep 12 '22 00:09 lopezloo

https://github.com/multitheftauto/mtasa-blue/blob/6b854c4e31d229ac17b9b8fec96546daa90390b7/Client/game_sa/CSettingsSA.cpp#L360

Attempted to disable that check, not sure if they're different than volumetric shadows but they have a different look in SP.

(disabled blob shadows) image

(singleplayer, very high settings) image

Haxardous avatar Sep 12 '22 01:09 Haxardous

Attempted to disable that check, not sure if they're different than volumetric shadows but they have a different look in SP.

I got similar response from @ccw808 years ago - "context switching issues". But I don't understand what issues exactly. Maybe it produces crashes or something. These shadows are disabled in SA-MP aswell.

In single player, these dynamic shadows are enabled for player ped only when visual quality option is set to "high". When quality is set to "very high", these are also enabled for non-player peds. In MTA, there are context switches and non player peds are sometimes processed as player ped, right? Maybe that was the cause. But if so, then we could just make it working for every ped (when enabled in MTA settings).

I have quickly commented a bit of code and it seems to be working only for the last created ped. But in single player, it's possible for many peds to have these shadows.

lopezloo avatar Sep 12 '22 01:09 lopezloo

Two possible reasons why its disabled:

  1. The dynamic shadows do not work on custom placed objects.

  2. Theres a hardcoded limit on how many dynamic shadows can be drawn at once which could easily be reached with a specific amount of people in multiplayer.

Both could results visual bugs or crashes, but maybe ccw can answer that for us.

ffsPLASMA avatar Sep 12 '22 09:09 ffsPLASMA

I made some progress: https://streamable.com/d8qdfo

Works properly so far. Currently testing it more. The limit is ~15~ 16 shadows, after that it starts rendering blob shadows.

lopezloo avatar Sep 12 '22 09:09 lopezloo