Page 1 of 1

Problem with textures not appearing

Posted: Fri Apr 14, 2006 5:33 pm
by The Purple Panzer
I posted a map on the map releases board, called Robbie's Map, which has been on one or two servers recently - but there is a problem. Four of the textures are used, one per base, to add a certain personality to that team; the textures are:

http://images.bzflag.org/purplepanzer/robbie.png
http://images.bzflag.org/purplepanzer/george.png
http://images.bzflag.org/purplepanzer/julia.png
http://images.bzflag.org/purplepanzer/pp.png

and they are indeed there (though I don't think the directory listing of http://images.bzflag.org/purplepanzer/ shows them, at least not yet).

I can test locally and see the images; yet other people visiting the server don't see them. They are listed as downloading, yet only blank boxes show up where there should be textures. (If you search the server list for Robbie you might find the map up and see what I mean, and also see the exact text in the map file.)

Not only can't I figure out what the problem is, I don't even know how to get further leverage to understand what is happening. Is it a size limit to the files? A download time limit, or some sort of timeout that the client has? Other files from that directory work just fine (albeit on other maps). As these textures really are one of the major points of the map, I'd very much like to figure it out.

Posted: Sun Apr 16, 2006 11:58 am
by anomaly
I noticed that in viewing the images the sizes were not poers of 2. The image size should be a power of 2, i.e., 512x512 128x128. Usually 1024x1024 is the largest that a 2D texture may be. Try resizing the images.

Posted: Sun Apr 16, 2006 12:56 pm
by Spazzy McGee
i'm sure someone (trepan?) said that the client automatically scaled textures that wern't Po2.... but i could be lying ;)

Posted: Sun Apr 16, 2006 1:15 pm
by anomaly
Spazzy is correct. I looked at the 2.0.6 source. The code does force Po2 alignment. So much for that theory.

PO2

Posted: Sun Apr 16, 2006 4:37 pm
by The Purple Panzer
Did you just mean that it *doesn't* have to be a power of 2 in size, that the code scales it appropriately?

The odd thing is that if I put the images in the bzflag/data directory, and change the texture lines to not have the "http://images.bzflag..." prefix, everything works fine (indeed this is how I develop maps, not having write access to images.bzflag.org/purplepanzer, at least not yet.) It's when I move the images (actually, have DTRemenak move them) to the web site that some don't show up. Some - not all. In this one map it is all of them, but in some others (the current Collaborator corner I'm doing is an example) some textures appear and some do not. I can't yet figure out what the common element is in the ones that don't work - it doesn't appear to be size.

This is what I mean by it being hard to know what to try next. The images do work if copied locally, but not over the web; so I don't think it's an image problem per se, but it might have something to do (grossly) with image size if there is, for instance, a timeout problem in the image download. I suppose I could try to generate a few dozen images (say all the same content, maybe one color value) at different sizes, and see which make it and which don't - that might be a useful datapoint.

Posted: Sun Apr 16, 2006 5:46 pm
by dango
i don't think you need the "http://"

Posted: Sun Apr 16, 2006 6:18 pm
by Teppic
Then how does it decide between http and ftp?

Posted: Sun Apr 16, 2006 7:33 pm
by anomaly
I believe the syntax for images on the web should include the protocol (http://) and what I meant by image size is not the total number of bytes but the pixel width and height. For instance http://images.bzflag.org/purplepanzer/robbie.png is 397px in width by 458px in height and 195079 bytes in size. Its the 397x458 thats not powers of 2. However the code will scale the images so thats not your problem. I always scale my texture images to Po2 anyway though.
I use this map code in a public server and it seems to work.

Code: Select all

material
  name GroundMaterial
  addtexture http://images.bzflag.org/zaphod/TarmacBlack.png
end
Noone has said anything yet at least.
I'm sure you realize that the URL is case sensitive. One thing to make sure is that the DownloadAccess.txt in your BZFlag directory hasn't been modified to deny images.bzflag.org. I'll look for the server online.