Project

General

Profile

Bug #547

Tiny flats thrashing the materials/texture systems

Added by danij about 16 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Urgent
Assignee:
Category:
-
Target version:
-
Start date:
2008-10-22
% Done:

100%


Description

Currently there is a problem where tiny flats cause constant thrashing of the material/texture systems due to the fact that prepareFlat2() never manages to load them if the lump size is smaller than 4096 bytes. This is especially evident in jHeretic where the sky flat (F_SKY1) is only 2x2 pixels and thus will never be loaded.

When asked for any info associated with a material (generator def, decoration def etc) the materials system will first check whether a texture has been loaded (material_t->dgl.tex != 0) and if not will make a call to GL_PrepareMaterial() to do so. The materials/texture system assumes that GL_PrepareMaterial() will always succeed.

How should we handle this? Enhance prepareFlat2() so that it always prepares something usable or build in a mechanism to prevent subsequent attempts to prepare materials once the first attempt fails?

Labels: Resources

History

#1 Updated by danij almost 16 years ago

Any thoughts skyjake?

#2 Updated by skyjake almost 16 years ago

I think that the flat preparation should be changed so that it loads the small flats as well. Or instead of just aborting if the flat size is not 4096, it should use some placeholder texture in that case.

Also available in: Atom PDF