Bug #910
Flat tiling error with custom flats
0%
Description
I made some 128*128 textures as flats using the material definitions. Ingame I notice the flat tiling breaks at some polygon borders. On walls the textures work just fine.
Labels: Graphics
Related issues
History
#1 Updated by jimigrey over 14 years ago
Ok, here's a screenshot: http://koti.mbnet.fi/jeejeeje/wip/doom_flat_tile_error.jpg
and wireframe overlayed: http://koti.mbnet.fi/jeejeeje/wip/doom_flat_tile_error_wire_overlay.jpg
#2 Updated by danij over 14 years ago
The screenshots are helpful but a small example would be much more useful.
#3 Updated by jimigrey over 14 years ago
Sure.. here's some little test map (in map01), material definitions and lowres textures in wad: http://koti.mbnet.fi/jeejeeje/wip/sw_testmap.zip
It happens more in areas with non square sectors...
#4 Updated by jimigrey over 14 years ago
I made a bit clearer example & screenshot of what's going on (also noticed I don't need to write material definitions to use textures as flats or other way around).
I made the floor use the damaged pipe texture, then I made some stairs which made a cut to the sector which creates the tiling error:
#5 Updated by danij over 14 years ago
#6 Updated by jimigrey over 14 years ago
I did some searching in the source code and found out that textures were aligned to 64*64 grid, but that makes any textures larger than 64*64 align incorrectly.
So I increased the grid size and large textures were aligned correctly as well.
In "edit_map.c" and "static void updateSSecMidPoint(subsector_t *sub)" I simply changed these two lines:
sub->worldGridOffset[VX] = fmod(sub->bBox0.pos[VX], 64);
sub->worldGridOffset[VY] = fmod(sub->bBox1.pos[VY], 64);
to:
sub->worldGridOffset[VX] = fmod(sub->bBox0.pos[VX], 512);
sub->worldGridOffset[VY] = fmod(sub->bBox1.pos[VY], 512);
Which would allow 512*512 and smaller textures to align correctly..
#7 Updated by danij over 12 years ago
Can you upload a small demo of the problem?
#8 Updated by skyjake about 11 years ago
- Tags set to Renderer, Textures
- Target version deleted (
1.9.0-beta6)
#9 Updated by skyjake about 11 years ago
- Tags changed from Renderer, Textures to Renderer, Materials
#10 Updated by skyjake over 7 years ago
- Target version set to Rendering