Open illwieckz opened 6 years ago
@gimhael the somwhat fix for #118 also somewhat fixes this (the texture is right but lighting is wrong):
It also somewhat fixes Unvanquished/Unvanquished#799 bug at least for the tree part:
But that variant of the bug is still remaining:
It was noticed in Unvanquished/Unvanquished#799 (see comment) that the wolf:et bug was introduced in 6cb4dcc but the source tree was buildable starting with commit 97cbb46 (those are translated commit ids in Daemon repository after engine split, see the other thread for commits ids on Unvanquished repository).
For testing purpose a snapshot of for-0.51.0 assets (including station15 map) can be fetched this way:
wget -O- http://gg.illwieckz.net/dl/unvanquished/dev/UnvanquishedAssets.get | xargs wget
For testing purpose one can load wolf:et's railgun map this way:
pimi.sh etmain
DEPS
file only and downloading a spawn layout so the game does not end at startup):mkdir -p ~/.local/share/unvanquished/pkg/etmain
mkdir -p ~/.local/share/unvanquished/game/layouts/railgun
ln -s ~/.etlegacy/etmain/pak0.pk3 ~/.local/share/unvanquished/pkg/etmain/pak0_0.dpk
ln -s ~/.etlegacy/etmain/pak1.pk3 ~/.local/share/unvanquished/pkg/etmain/pak1_0.dpk
ln -s ~/.etlegacy/etmain/pak2.pk3 ~/.local/share/unvanquished/pkg/etmain/pak2_0.dpk
wget -O ~/.local/share/unvanquished/pkg/etmain/res-etmain_0.dpk http://dl.illwieckz.net/b/unvanquished/extra/foreign-maps/etmain/pkg/etmain/res-etmain_0.pk3
wget -O ~/.local/share/unvanquished/pkg/etmain/map-railgun_0.dpk http://dl.illwieckz.net/b/unvanquished/extra/foreign-maps/etmain/pkg/etmain/map-railgun_0.pk3
wget -O ~/.local/share/unvanquished/game/layouts/railgun/spawn.dat http://dl.illwieckz.net/b/unvanquished/extra/foreign-maps/etmain/game/layouts/railgun/spawn.dat
railgun
map with the cheat to never end on missing spawn:daemon -pakpath ~/.local/share/unvanquished/pkg/etmain/ +set g_neverend 1 +devmap railgun
railgun
map with the spawn
layout:daemon -pakpath ~/.local/share/unvanquished/pkg/etmain/ +devmap railgun spawn
note that the unattended side-effect "somewhat fix" previously talked about is not there anymore, bug was brought back when lighting was fixed, i.e the complete fix for the other bug left this one unmodified despite some work in progress had some effect on this.
The tree thing seems still true as of 0.52.1:
image deleted to avoid wasting people's bandwidth
Your screenshot doesn't depict the bug, it is worked around by r_clear
being enabled, well, it is less obvious with r_clear
being enabled, and the screenshot is too low resolution to notice the bug precisely, the bug only affects the tip of one branch, you'll need to zoom-in more.
Anyway the bug is still there
Then I'm failing to understand the problem.
This may help: https://imgsli.com/ODgwMjI
please upload images instead of linking them, for future reviewers. Also, which side should be the good one?
Those are the images in first post, just reuploaded with a slider.
This is probably related to the fact those two models are colliding.
I believe this is caused by a mismatch between the depth shader and the main shader stage. The depth shader assumes that the alpha for alphaFunc GE128
should come from the image. But the main shader takes the alpha from the vertex data because the tree is using vertex lighting.
I believe this is caused by a mismatch between the depth shader and the main shader stage. The depth shader assumes that the alpha for
alphaFunc GE128
should come from the image. But the main shader takes the alpha from the vertex data because the tree is using vertex lighting.
This does not seem to be the case. Both use u_ColorModulate
= [1.00, 1.00, 1.00, 1.00]
, so it takes the vertex colour and multiplies it by the diffuse. Both have some alpha values set.
Depth buffer after depth pass on the tree:
A lot of the vertexes have very low colour values, <= 10. Some others have colour values up to about 60, which is probably where the discrepancy comes from, since they're just multiplied by the diffuse.
Here's the colour buffer after rendering this tree, with colour values normalized in range of [0.0, 0.00390625]:
So it's probably a map/shader bug.
Was it an answer for the bad vertex lighting:
Or for the part of the tree not being rendered?
I could be wrong about the specifics of how the depth shader is mismatched. But disabling depth pass with #1412 fixes the issue
Or for the part of the tree not being rendered?
Point is, nothing's not being rendered. It looks black because the resulting colour is very close to 0.
So either the original issue was fixed at some point, or there was no void there in the first place.
It looks black because the resulting colour is very close to 0.
That's not it. The bug is nothing being rendered at all in some pixels. It can be clearly seen if you turn off r_clear
; if you don't see it maybe it doesn't happen on your machine.
Ohh, I found where that is happening now. Apparently it's like one small part of a branch that's affected.
Yes, only a small part of the branch, the part colliding with the other plant.
Sometime I do believe we may have some r_clearColor
cvar to debug such thing.
Ah, found the issue now.
LightMapping shader multiplies with the vertex colour first, and then does the u_AlphaThreshold
check:
https://github.com/DaemonEngine/Daemon/blob/559e2df4bd6dd51943d742f21a3cdef7cd47e677/src/engine/renderer/glsl_source/lightMapping_fp.glsl#L102-L108
While the generic shader, which is used by the depth pre-pass, does the u_AlphaThreshold
check first, and then does the multiply:
https://github.com/DaemonEngine/Daemon/blob/559e2df4bd6dd51943d742f21a3cdef7cd47e677/src/engine/renderer/glsl_source/generic_fp.glsl#L64-L76
LightMapping shader multiplies with the vertex colour first, and then does the u_AlphaThreshold check
Maybe that's wanted for terrain blending?
Maybe that's wanted for terrain blending?
I suppose so. I think just doing the multiplication first in generic shader should fix this issue.
See that weird void effect at the tip of the conifer branch:
It must look like this:
Note that the bug seems to occur on the collision with the plant leaf model. For information, there is also an alphagen brush in source map at this place:
This bug looks somewhat related to that bug noticed in wolf:et map (at least for the tree): https://github.com/Unvanquished/Unvanquished/issues/799#issuecomment-253367127