godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
89.07k stars 20.19k forks source link

GLES3: Godot game is not loading shadow_atlas_size defined in project settings #80186

Closed WhalesState closed 1 year ago

WhalesState commented 1 year ago

Godot version

4.1.1-stable

System information

Windows 10

Issue description

When the project loads in editor, all the settings defined in project settings will be loaded over the default values, but when running the game nearly 95% of them will be ignored resulting in just loading the default settings.

here it's just loading only 4 variables from project setting and i have added the fifth in this pull request https://github.com/godotengine/godot/pull/80151 image

AThousandShips commented 1 year ago

They are loaded but not in main.cpp, as most settings they are loaded in the server?

Like here: https://github.com/godotengine/godot/blob/237bd0a615df8a0e57bc3d299894abece7b43a0c/servers/rendering/renderer_rd/environment/sky.cpp#L722-L724 https://github.com/godotengine/godot/blob/237bd0a615df8a0e57bc3d299894abece7b43a0c/servers/rendering/renderer_scene_cull.cpp#L4148-L4150 https://github.com/godotengine/godot/blob/237bd0a615df8a0e57bc3d299894abece7b43a0c/servers/rendering/renderer_rd/renderer_scene_render_rd.cpp#L1289-L1309

WhalesState commented 1 year ago

what about rendering/2d/shadow_atlas/size ? can you confirm that it's loaded on start ? i will search other 3d shadow settings if they are loaded too

AThousandShips commented 1 year ago

Found with a simple search in a few seconds: https://github.com/godotengine/godot/blob/237bd0a615df8a0e57bc3d299894abece7b43a0c/servers/rendering/renderer_rd/renderer_canvas_render_rd.cpp#L2609

WhalesState commented 1 year ago

this just loads it for vulkan, what about canvas_renderer_gles3 ? can you confirm that they loads in gles3 too ?

AThousandShips commented 1 year ago

~Are you sure? This is the rd renderer, not the forward renderer AFAIK~

But I'd suggest you search around yourself, not something I have time for

Calinou commented 1 year ago

Are you sure? This is the rd renderer, not the forward renderer AFAIK

rd (RenderingDevice) renderer code affects Forward+ and Mobile, but not Compatibility. This is because RenderingDevice only tailors to modern low-level graphics APIs (Vulkan, Direct3D 12, Metal, WebGPU).

WhalesState commented 1 year ago

trust me i have tried it with the stable release using gles3 renderer and it doesn't load the rendering/2d/shadow_atlas/size on running the game and it will be ignored on game startup but not in editor

AThousandShips commented 1 year ago

Then it should be handled under the appropriate place in the compatibility renderer code

WhalesState commented 1 year ago

so i should load them in canvas_renderer_gles3 if something is messing for 2d, and also check the scene_renderer_gles3 if something is messing in 3d, right ?

AThousandShips commented 1 year ago

Yes exactly, look at the equivalent for rd and apply when applicable

WhalesState commented 1 year ago

https://github.com/godotengine/godot/blob/master/drivers/gles3/rasterizer_scene_gles3.cpp most of the functions are left empty and it's just loading only 3 variables from project settings, this will require so much work and should be addressed in a new issue, i will just review the rasterizer_canvas_gles3 and push what's missing.

WhalesState commented 1 year ago

fixed in https://github.com/godotengine/godot/pull/80151, closing now

akien-mga commented 1 year ago

The bug is not fixed until that PR is merged, so it should be kept open. You can add "Fixes #80186" in the PR to clarify the relationship.