Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Matrix tile texturing,..its not tiling the texture, it stretches it

Author
Message
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 14th Nov 2003 17:30
Another interesting switch. If I have a 256x256 size matrix tile (not matrix just one tile of it) and I texture map a 128x128 texture onto it, it should tile that texture map 4 times? right? Well instead, its stretching the 128x128 across the entire tile. Ive tried the different methods of texturing the tile, ie tiling, mirror and border color, but i was looking at using the tile method mostly.
Is this a bug?? or is it suppose to stretch the texture to fit the tile in one shot? I dont mind it doing that as long as that is how its suppose to do it, even though the docs say otherwise. However, stretching the bit map over a larger surface does make it very grainy and blocky, and would require a much larger texture to try to combat the pixelation it causes. Anyhow im getting over detailed here,...if its a bug then i assume it will be fixed,..if its a feature then I will use it LOL...
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2003 17:53
Your 256x256 matrix tile is not pixels, its db units,

each matrix tile can only hold one part of your texture file. 128*128 is not really big enough and will look blocky.

so if you create your matrix with

MAKE MATRIX 1,2000,2000,50,50

you get a matrix 2000 units wide by 2000 units high split up into 2500 tiles (50X50). Each tile will be 2000/50 units wide = 40

each of these 2500 tiles can have 1 texture from your 'prepared' texture which is 1 image split up into many images.

so if your prepared texture is an image with 4 textures (one in each corner) you can tile your matrix with a mixture of any of those four images

Another dependecy is what res you are running in. Run at 640X480 and of course it will look blocky. Run at 800*600 or 1024*768 and it will look much better.

Boo!
DcZee
23
Years of Service
User Offline
Joined: 28th Apr 2003
Location:
Posted: 14th Nov 2003 19:09
Thanks for the reply,..

True,..and I can see all of that but, how do I determine from that if the texture im using will be stretched or tiled onto the targeted matrix tile? Through calculations ive found that the db world unit is equivalent to my texture units. It seems to be tiling a one to one pixel/db unit relationship. Im using a 16384 matrix divided 64x64, so the db unit tile size is 256. The 128x128 tex map should map onto that 4 times??
If my 128x128 texmap is stretched onto a 256x256 db unit tile then what would happen to my 128x128 placed onto a 40x40 db unit tile??
I guess im not understanding the mapping process,..all the other stuff I understand,..but the mapping doesnt make sense to me??
Does DBpro auto stretch or reduce my texture to fit the the tile size??
I have ways around the blockiness in either case (just adjusting the texture does that)
deX
22
Years of Service
User Offline
Joined: 12th Nov 2003
Location:
Posted: 14th Nov 2003 19:15
afaik... your texture is scaled to fit in a single tile. if you have more than one texture in your image, eg 4, your texture would be enlarged twice as much.


-deX
spooky
23
Years of Service
User Offline
Joined: 30th Aug 2002
Location: United Kingdom
Posted: 14th Nov 2003 20:46
Your texture is always stretched to fit into the tile.

Whether your tile is 1 unit, 10 units or 100 units, it makes no difference, your texture will always stretch to fill entire tile.

Just change your matrix. instead of 16384,16384,64,64 change it to
1000,1000,32,32 and you will see it makes no difference.

Keep experimenting and you will quickly understand.

Boo!

Login to post a reply

Server time is: 2026-07-26 12:48:28
Your offset time is: 2026-07-26 12:48:28