#4351 closed enhancement (fixed)
[PATCH] Shadow map improvements
Reported by: | Vladislav Belov | Owned by: | Vladislav Belov |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 23 |
Component: | Core engine | Keywords: | patch |
Cc: | Patch: |
Description (last modified by )
Planned features:
- Quality level selection (exists in current state): from Very Low (1/4x original size) to Very High (4x original size).
- PSM optimization.
Current state: https://github.com/vladislavbelov/0ad/tree/shadows Comparasion:
Attachments (2)
Change History (24)
by , 7 years ago
Attachment: | shadows_resized.png added |
---|
comment:1 by , 7 years ago
Keywords: | patch rfc added |
---|---|
Owner: | set to |
Status: | new → assigned |
Summary: | Shadow map improvements → [PATCH] Shadow map improvements |
comment:2 by , 7 years ago
Description: | modified (diff) |
---|
follow-up: 5 comment:3 by , 7 years ago
comment:5 by , 7 years ago
Replying to gameboy:
@vladislavbelov: Your patch is very good, you can formally submit them, I would like to know, you have to add the graphics anti aliasing features.
I couldn't commit, so I'm waiting for dev comments/review. There is a work about FXAA (https://wildfiregames.com/forum/index.php?/topic/20175-programmer-graphics-gameplay-ai-mikita-hradovich-yet-another-game-developer-wants-to-participate/&page=2), but it looks blured. I will test FXAA & SSAO, but I'm not sure that will be ok.
comment:7 by , 7 years ago
Replying to Lionkanzen:
Add review tag to your work.
Review queue for final patches, before it should be in the rfc queue.
comment:9 by , 7 years ago
Yes, about the graph anti-aliasing patch, the people who make the patch we have not contact with him, his patch still exist many problems not be processed Maybe you can refer to his graphic anti-aliasing capabilities, make your graphics anti-aliasing patches. http://trac.wildfiregames.com/ticket/3640
comment:12 by , 7 years ago
Keywords: | review added; rfc removed |
---|---|
Milestone: | Work In Progress → Alpha 23 |
Priority: | Should Have → Must Have |
The options part can luckily become written way more elegantly now that options.js is agnostic of options.json, that we we can specify the value range -2 to +2 in the options.json file with a dropdown or better a slider.
The C++ patch is very very simple as it only scales the shadow texture size by a factor of 2. (Which explains why we only have -2 to +2 in the options).
The patch is correct because using the screensize as the texture size isn't perfect, considering that we don't use the top down perspective and therefore map multiple terrain pixels to a screen pixel.
The patch is a must have because the effects are great, especially when trying to render promotional material!
comment:14 by , 7 years ago
Perhaps we need a warning for people with low-memory graphic cards and a higher number for people with high memory graphic cards. Tried to increase the Ultra setting by 2x for the trailer and I got out of memory errors.
comment:16 by , 7 years ago
Replying to stanislas69:
Maybe we could disable it somehow for low end computers.
No need to do so, middle is default value, so if even this value doesn't work then nonpatched version won't work too. Also it's hard to detect free memory by many reasons.
But I want to implement shadows map changing without reloading.
comment:18 by , 7 years ago
It does not fix the flickering (just for the record: the flickering means the shadow changing position depending on the camera angle quickly) at all. It just makes it less visible the higher the shadow map resolution becomes.
Try reading the C++ patch, it's easy to understand. The shadow map size is just the closest power of 2 of the screensize, so 1024x1024 or 2048x2048 and this patch multiplies that with 1/4, 1/2, 1, 2 or 4.
@vladislavbelov: Your patch is very good, you can formally submit them, I would like to know, you have to add the graphics anti aliasing features.