[pr-fix][rendering] A texture that is not there yet gets a stand-in picked by what it is used for (DARNER_EFFECT_CLEAR) #380
Loading…
Reference in a new issue
No description provided.
Delete branch "mrfuzzypants/Darner:effect-squares-stand-in"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Contributor role (optional)
What it changes
The problem on main: read from the code only, then seen in the game.
neutral_for(crates/darner-gpu/src/descriptor/host.rs) gives every 2D slot whose texture is not there yet one texel of gray, 0x80 in all four channels, alpha included. An effect sprite (smoke, dust, blood, sparks) draws that as a solid half-cover square, and an HDR glow the title draws added draws it as a bright one: the "smoke, blood and water show as coloured squares" known issue on #197.This is the stand-in VIctory's fork already uses (
VICTORY_EFFECT_CLEAR), ported without a change of Darner's own. The stand-in is picked by what such a texture is used for:STRONGa one-channel mask goes blackSTRONG: black would tilt every normal and shift every distorted pixelDARNER_EFFECT_CLEAR(on unless0;strongis the variant above) is read once at the start and has a row in F1 under PICTURE, EFFECT SQUARES STAND-IN, next to TEXTURE LOD BIAS.DARNER_EFFECT_CLEAR=0is byte for byte the stand-in of today: the gray texture is still made once, by the same function, and the slots that took it keep taking that very texture. The clear and black ones live in their own table, made once, at most eight textures.What this does not do: the texture is still missing when it is sampled. It hides the square, it does not make the texture arrive. An effect that lasts long enough can still show nothing where the square was, and the count line says how often the stand-in is used, so a scene where it is used for a long time is measurable rather than guessed at.
How it was tested
d4c1232, onmainf3840d7.cargo test --locked -p darner-gpu --lib descriptor::host::tests— 95 tests, 94 passed, 0 failed, 1 ignored, including a newa_stand_in_is_picked_by_the_kind_of_texture_it_replaces(BC7 clear, BC6H and BC5 SNORM black, BC4 gray, BC5 gray with STRONG, and gray for every format with the switch off).cargo build --release --locked -p darner— clean,target\release\darner.exe.cargo xtask policy --staged— 0 files (nothing staged at that point); the diff adds one line toREADME.mdand no data files.descriptor::hostonly; gate 1 and gate 2 not run by me.DARNER_EFFECT_CLEAR=0and gone without it, same scene and settings; that is a rendering result, not a performance one, and it is one PC.Checklist
main.docs/asset-policy.md.Checked for overlap
Code review only (read the diff at
d4c1232), nothing built or run.stand_in_ofpicks by format only, so withDARNER_NEUTRAL_ALL_KINDSon (the default) a BC6H or SNORM cube or 3D slot now gets the black stand-in, wheremaingives it gray. A streaming HDR reflection or sky probe would read black again.DARNER_NEUTRAL_ALL_KINDS=0does not avoid this: cubes then get a null view, which also reads 0. OnlyDARNER_EFFECT_CLEAR=0givesmain's result. Suggested fix: keepStandIn::Grayfor every kind exceptNeutral::Flat.has_alphaincludes BC1, BC3, BC7 and RGBA8, which are also cutout foliage, fences and hair. With alpha 0, aclip(alpha - 0.5)discards the whole surface while its texture is missing, wheremain's 0x80 passes. That may show as leaves or props vanishing for a frame (#135, #263). Worth an A/B at a foliage-heavy spot withDARNER_EFFECT_CLEAR=0against the default.NEUTRAL_KINDSdoc and the copystat line still say "gray stand-in" but now count clear and black ones too.=0path (same gray texture asmain),is_neutralcovering the new textures, and the R32_FLOAT occlusion image staying gray.neutral_of,NEUTRALS,is_neutral), whose retry would also need to cover the newSTAND_INStable, and with #335 (neutral_for).Reviewed with Claude Code (AI-assisted); findings checked by a human before posting.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.