DaemonEngine / Daemon

The Dæmon game engine. With some bits of ioq3 and XreaL.
https://unvanquished.net
BSD 3-Clause "New" or "Revised" License
299 stars 60 forks source link

Some weird lines with CRN files #1056

Closed illwieckz closed 2 weeks ago

illwieckz commented 7 months ago

Reported on IRC today by @sweet235.

JPEG:

oIk

CRN:

Iju

I noticed it with other textures in the past, on my end the glitch changes with the distance.

The bug is there since years. I suspect a bug in the mipmapping code.

The mipmap images are already part of the CRN file. When I convert CRN to DDS with crunch (that I assume to only change the container, not recompress the file), and load the DDS in GIMP, I see no issue in the precomputed mip-map images. So I assume this is a bug in our renderer.

VReaperV commented 6 months ago

Forcing a specific mipmap level (no interpolation) might help identify the issue.

slipher commented 6 months ago

Using Forlorn's floor texture as my testbed, I tried the 0.52.1 engine with recent assets and the bug was there. But 0.52.1 engine with 0.52.1 assets does not have the bug. So this suggests the possibility of an asset pipeline bug.

It does seem to be specific to certain mip levels. Setting various values of r_picmip or r_imageMaxDimension resulted in either the lines going away, or becoming bigger (due to lower resolution).

sweet235 commented 1 month ago

So this suggests the possibility of an asset pipeline bug.

This seems to be the case. I see similar lines with for textures/shared_ex_src/light2. When I convert the corresponding 5 png images to crn using crunch commit 4c4a009, the lines disappear.

I used commands like this one: crunch -out light2_a.crn -fileformat crn light2_a.png

slipher commented 1 month ago

I discovered a cvar r_exportTextures which causes the engine to dump all images it loads, including all mip levels, as KTX files. I tested with a 256x256 floor texture which looks the same as the one from OP screenshot (but the map was Forlorn). When opened in a KTX viewer program, the 128x128 mip level shows several black lines, and the 32x32 level shows one.

image

VReaperV commented 1 month ago

So every 16 texels it seems like.

VReaperV commented 2 weeks ago

From dev channel:

simply re-converting form png to crn fixes this

So I suppose we can close this as not-an-engine-bug.

illwieckz commented 2 weeks ago

Yes, I have a full-asset rebuild on my end and I can't reproduce the bug anymore.