Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: #2653
The
realshadow system (dDlst_shadowReal_c) is limited to 8 slots per frame (mReal[8], packed 4-per-channel intomShadowTexObj[2]). Once the pool is full,dDlst_shadowControl_c::setRealevicts the farthest entry in the z-sorted lis or drops the new shadow entirely if it is farther than all existing onesBecause eviction is driven by
getCameraZ(), the missing shadows change with the camera angle. With ~8–10 shadowed actors on screen (e.g. NPCs/cats in a scene (even link lost his shadow)), 5+ of them intermittently lose their shadows.some escenarios
include/d/d_drawlist.h:REAL_SHADOW_MAX = 16andREAL_SHADOW_TEX_NUM = REAL_SHADOW_MAX / 4constants.mReal[8]→mReal[REAL_SHADOW_MAX].mShadowTexObj[2]/mShadowTexData[2]→[REAL_SHADOW_TEX_NUM](4).src/d/d_drawlist.cpp:init():l_realImageSizeexpanded toREAL_SHADOW_TEX_NUMentries({192, 192, 64, 64} — keeps the original large/small split), loop bound updated.
reset(): loop bound8→REAL_SHADOW_MAX.setReal(): pool-full check and free-slot scan8→REAL_SHADOW_MAX.Each
dDlst_shadowReal_cis ~9.5 KB (mShadowTri[256]), so this adds ~76 KB more or less todDlst_shadowControl_c/dDlst_list_c. Acceptable for the fix i think no?its need more testing, if someone can helpme this is the way
imageDrawtexture packing for <8 and 9–16 shadows.dVar17 < -1000) still drops far shadows correctly.