Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (AndrewAMD, degenerate_762, ozgur), 1,311 guests, and 0 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Strange texture scaling problem #406313
08/16/12 19:57
08/16/12 19:57
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
Hi,
Just encountered a new problem, i absolutely dont know why this happens.

SMall flashback:
For my project, i have a texture(1024*1024) which is seperated into 64px sized tiles, making a 16*16 texturegrid.

When i need to retexture a surface, i shift its skinning setup to match the required textures.

i defined a float which holds the Skin size of one tile(since its normalized between 0-1, the value is 1.0/16.0) to set the skin setup accordingly.

However, this resulted in filter problems, as the closest pixel of the nearest tileneighbour was filtered into the required tile. An unacceptable mixup.

SO i go tthis idea:
i load my texture and move the tiles into a new, slightly bigger texture. This creates a 1px sized border around each tile, which allows me to do 1pixel tiling. So filtering will use a correct pixel of the same texture.

Examples:
each tile has a size of 64pixel and is centered in a 66px sized tile on the new texture(new texture is 1056*1056)


this allows me to fill the gaps with a row/line of 1 pixel width, which is taken from the oposite of the tile(so its 1 pixel tiling).



as i didnt change anything else in my sourcecode, i expected tiny blackborders on each blocksurface. I had my 1/16 factor in mind and that its procedual and not fixed due to the normalisation.

But instead i got this:


as if i scaled down by 0.25, 4 tiles fit one surface. The factor doesnt fit anymore.

The texture is applied to a material skin. The material uses its skin1 and the UV setup of the entity to paint the texture.

Why does this happen? because 1056 is an odd number? How do i handle this?

Greetings
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: Strange texture scaling problem [Re: Rackscha] #406314
08/16/12 20:40
08/16/12 20:40
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
1056*1056 is a bad texture format, this will result in a 2048x2048 bitmap and thus 1/16 results in 2 of your tiles (in one direction).
I don't think that your current approach is the way to go. What I would probably do, at least try, is to deactivate mip mapping/ filtering and realize a simple (object or pp) blur myself.


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Strange texture scaling problem [Re: Superku] #406315
08/16/12 20:52
08/16/12 20:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
mh okay, but i need a bit help for the blur stuff on object surfaces :|
Havent done this, yet

edit: well, i have been a bad boy. Just blitted the tiles to the 2048px tex. And all sem/tilingproblems are gone grin




maybe its not perfect, but until i get it working per shader, this should do it. AT least this memory is consumed only once(and the fps is even a bit more stable with the bigger texture...o.O?!)

Last edited by Rackscha; 08/16/12 21:21.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1