hzqst / MetaHookSv

MetaHook (https://github.com/nagist/metahook) porting for SvEngine (GoldSrc engine modified by Sven-Coop)
MIT License
142 stars 32 forks source link

[Renderer][CS/CZ] Shadow maps not working for teammates #245

Open di57inct opened 1 year ago

di57inct commented 1 year ago

Captură de ecran 2023-02-09 143521

hzqst commented 1 year ago

Should have been fixed in the latest build (same issue: #253)

di57inct commented 1 year ago

Not fixed, shadow maps don't work for anything now. There's also a new bug on viewmodels with no attachment:

https://user-images.githubusercontent.com/3608544/221583149-37cfcfec-baa9-47c0-a6ac-112ce91505ad.mp4

di57inct commented 1 year ago

any update on this?

hzqst commented 1 year ago

image Should have been fixed in https://github.com/hzqst/MetaHookSv/releases/tag/v20230416a

di57inct commented 1 year ago

https://user-images.githubusercontent.com/3608544/232324913-249d68c4-d4e1-4395-b02b-4afb6dab1f94.mp4

Not fixed on my side. Tried both AVX2 and normal renderer and bp versions.

|index|api| plugin name| plugin version| | 0| v2| Gmcx_model_effect.dll| | | 1| v4| StudioEvents.dll| 2023-04-16T09:23:01| | 2| v4| BulletPhysics_AVX2.dll| 2023-04-16T09:21:11| | 3| v4| Renderer_AVX2.dll| 2023-04-16T09:22:47| | 4| v4| CaptionMod.dll| 2023-04-16T09:21:24|

Processor Information: CPU Vendor: AuthenticAMD CPU Brand: AMD Ryzen 5 1500X Quad-Core Processor
CPU Family: 0x17 CPU Model: 0x1 CPU Stepping: 0x1 CPU Type: 0x0 Speed: 3500 Mhz 8 logical processors 4 physical processors HyperThreading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Supported SSE41: Supported SSE42: Supported AES: Supported AVX: Supported AVX2: Supported AVX512F: Unsupported AVX512PF: Unsupported AVX512ER: Unsupported AVX512CD: Unsupported AVX512VNNI: Unsupported SHA: Supported CMPXCHG16B: Supported LAHF/SAHF: Supported PrefetchW: Unsupported Operating System Version: Windows 11 (64 bit) Video Card: Driver: Radeon RX 580 Series DirectX Driver Name: aticfx32.dll Driver Version: 31.0.14043.7000 DirectX Driver Version: 31.0.14043.7000 Driver Date: 3 26 2023 OpenGL Version: 4.6 Desktop Color Depth: 32 bits per pixel Monitor Refresh Rate: 144 Hz DirectX Card: Radeon RX 580 Series VendorID: 0x1002 DeviceID: 0x67df Revision: 0xe7 Number of Monitors: 1 Number of Logical Video Cards: 1 No SLI or Crossfire Detected Primary Display Resolution: 1920 x 1080 Desktop Resolution: 1920 x 1080 Primary Display Size: 20.91" x 11.73" (23.94" diag) 53.1cm x 29.8cm (60.8cm diag) Primary Bus Type Not Detected Primary VRAM Not Detected Supported MSAA Modes: 2x 4x 8x

hzqst commented 1 year ago

unknown_replay_2023.04.16-18.44.mp4 Not fixed on my side. Tried both AVX2 and normal renderer and bp versions.

|index|api| plugin name| plugin version| | 0| v2| Gmcx_model_effect.dll| | | 1| v4| StudioEvents.dll| 2023-04-16T09:23:01| | 2| v4| BulletPhysics_AVX2.dll| 2023-04-16T09:21:11| | 3| v4| Renderer_AVX2.dll| 2023-04-16T09:22:47| | 4| v4| CaptionMod.dll| 2023-04-16T09:21:24|

Processor Information: CPU Vendor: AuthenticAMD CPU Brand: AMD Ryzen 5 1500X Quad-Core Processor CPU Family: 0x17 CPU Model: 0x1 CPU Stepping: 0x1 CPU Type: 0x0 Speed: 3500 Mhz 8 logical processors 4 physical processors HyperThreading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Supported SSE41: Supported SSE42: Supported AES: Supported AVX: Supported AVX2: Supported AVX512F: Unsupported AVX512PF: Unsupported AVX512ER: Unsupported AVX512CD: Unsupported AVX512VNNI: Unsupported SHA: Supported CMPXCHG16B: Supported LAHF/SAHF: Supported PrefetchW: Unsupported Operating System Version: Windows 11 (64 bit) Video Card: Driver: Radeon RX 580 Series DirectX Driver Name: aticfx32.dll Driver Version: 31.0.14043.7000 DirectX Driver Version: 31.0.14043.7000 Driver Date: 3 26 2023 OpenGL Version: 4.6 Desktop Color Depth: 32 bits per pixel Monitor Refresh Rate: 144 Hz DirectX Card: Radeon RX 580 Series VendorID: 0x1002 DeviceID: 0x67df Revision: 0xe7 Number of Monitors: 1 Number of Logical Video Cards: 1 No SLI or Crossfire Detected Primary Display Resolution: 1920 x 1080 Desktop Resolution: 1920 x 1080 Primary Display Size: 20.91" x 11.73" (23.94" diag) 53.1cm x 29.8cm (60.8cm diag) Primary Bus Type Not Detected Primary VRAM Not Detected Supported MSAA Modes: 2x 4x 8x

I think it's probably because the shadow was blocked by localplayer model. Could you please try hiding the localplayer model (either by setting pev.effects to EF_NODRAW or rendermode to kRenderTransAlpha/kRenderTransTexture) and see if the issue still presists?

di57inct commented 1 year ago

I think it's probably because the shadow was blocked by localplayer model. Could you please try hiding the localplayer model (either by setting pev.effects to EF_NODRAW or rendermode to kRenderTransAlpha/kRenderTransTexture) and see if the issue still presists?

Tried both nodraw and transparency. Didn't solve the issue. AMXX script(tried post-think too):

#include <amxmodx>
#include <engine>

public client_PreThink(iID)
{
    if (is_user_bot(iID))
        return;

    //entity_set_int(iID, EV_INT_effects, entity_get_int(iID, EV_INT_effects) | EF_NODRAW)
    entity_set_int(iID, EV_INT_rendermode, kRenderTransTexture)
    entity_set_float(iID, EV_FL_renderamt, 0.0)
}

The round shadow map is only visible if the player is holding a view model with no attachment and if r_flashlight_attachment is 1.

https://user-images.githubusercontent.com/3608544/233864376-26e16835-6d92-4788-8d12-d569f61cbe98.mp4

di57inct commented 1 year ago

image Should have been fixed in https://github.com/hzqst/MetaHookSv/releases/tag/v20230416a

Tested on latest Steam CZ version:

https://user-images.githubusercontent.com/3608544/235327886-1d595793-f47a-49ef-9e40-a67be615352e.mp4

Screenshot_1

https://user-images.githubusercontent.com/3608544/235327887-a1555ac5-9125-4c93-bf80-52dabb0a8956.mp4

After 2+ minutes passed:

https://user-images.githubusercontent.com/3608544/235328058-d05fe3f7-cd87-409f-b0b8-7627eea268ee.mp4

di57inct commented 1 year ago

Update: tested on Ryzen 9 7900x cpu integrated graphics using latest driver version as of today and the same issue is present so it's not a problem related to the rx580 gpu only. Riva tuner overlay was also not running this time, so that wasn't the problem either. Would you like me to test in any other scenario(different driver version, etc)? Edit: forgot to mention, the bug from the previous post's last 2 videos is related to bloom. After disabling bloom the bug doesn't happen anymore. Didn't test this one on the new gpu.

di57inct commented 1 year ago

EDIT: removing bullet physics doesn't solve the issue. EDIT3: tested on both dedicated and listen server

Update: found the problem. Shadow maps work when bv_debug is 1 and then don't when set back to 0.

] mh_pluginlist 
|index|api|             plugin name|          plugin version|
|    1| v4|        StudioEvents.dll|     2023-04-28T11:10:04|
|    2| v4|  BulletPhysics_AVX2.dll|     2023-04-28T11:07:47|
|    3| v4|       Renderer_AVX2.dll|     2023-04-28T11:09:49|
|    4| v4|          CaptionMod.dll|     2023-04-28T11:08:00|

Screenshot 2023-05-17 191537

EDIT2: after removing _ragdoll.txt files(shadows maps still don't work without bv_debug 1):

https://github.com/hzqst/MetaHookSv/assets/3608544/182d01f8-573a-4e5d-ad34-c75f7039fab9

https://github.com/hzqst/MetaHookSv/assets/3608544/0a1ab10e-5a09-4ca7-b6d4-19dd4c8f37f5

hzqst commented 1 year ago

image image The problem cames from unexpected attachment position (right placed on the floor) when using knife, which should have been fixed in https://github.com/hzqst/MetaHookSv/releases/tag/v20230528a

di57inct commented 1 year ago

Confirming attachment problem fixed, but main problem is still present.

https://github.com/hzqst/MetaHookSv/assets/3608544/318d862f-74c3-44d0-a72a-699e987463aa

di57inct commented 1 year ago

Confirming as working on RTX 4080. Seems like it's a per-card/driver isolated issue: Captură de ecran 2023-06-22 001312

hzqst commented 7 months ago

Wait for AMD to fix then

https://community.amd.com/t5/opengl-vulkan/sampler2dshadow-based-shadow-mapping-doesn-t-work/m-p/657962?lightbox-message-images-657962=102149i3C0F3D7667EDDD9F#M5101

di57inct commented 7 months ago

If you're sure it's because of amd drivers go ahead and close the issue since it's not mhsv fault