PDA

View Full Version : problem of texture rendering in wld files


sandy
07-06-2004, 02:10 PM
www.projecteq.net/files/sandy/karnorbug.jpg

as you see i'm trying to render the karnor zone, but i have an issue i really don't understand, some polygons don't care the uv coords taken in the wld and render with tiny textures like on the screenshot !

did i miss a value in the wld files that controls that ?

I divide all u and v i take from files by 256.0f and all the polygons I process seems to have good mapping values and render well

so why does some polygons render so tiny ???

any idea ?

Windcatcher
07-06-2004, 03:37 PM
I just went over the OpenZone code. First, make sure you're treating the texture coordinates as unsigned values. Second, check to see if the .WLD is an old-format or new-format file. In new-format files the texture coordinates are 32 bits instead of 16 bits. However, you're probably already getting that right or you probably wouldn't be able to read the .WLD file.

I suspect that the 256 multiplier might have to do with the texture size. When I wrote OpenZone all textures were 256x256, but I'm not sure what would happen if the texture was 512x512 instead, for instance. You *might* have to divide by 512 then, but I'm not sure. My gut tells me that it's a signed vs. unsigned problem.

sandy
07-07-2004, 12:28 AM
woot thank you it was that =)
I have a nice karnor now !