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
1 registered members (7th_zorro), 1,390 guests, and 2 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
problem with vec_to_uv #406180
08/14/12 22:10
08/14/12 22:10
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,
I have a plane(2 faces, 4 vertices), and i tried to modify its UV setup.

i have a texture which contains 16*16 tiles, and i want to place the UV setup on one tile.

So i thought for the quick and dirty way, i use vec_to_uv. But somehow the effect does not apply.

for the "num" parameter, i use the vertex number of the mesh vertex and not the uv-vertex?
x/y are normalized 0..1 right?

so, shouldnt this setip the surface for the first tile in the upper left corner of the texture?

Code:
LVec.x = 0;
	LVec.y = 1/16;
	vec_to_uv(LVec, ACell.ent, 1);
	LVec.x = 0;
	LVec.y = 0;
	vec_to_uv(LVec, ACell.ent, 3);
	LVec.x = 1/16;
	LVec.y = 0;
	vec_to_uv(LVec, ACell.ent, 4);
	LVec.x = 1/16;
	LVec.y = 1/16;
	vec_to_uv(LVec, ACell.ent, 2);




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: problem with vec_to_uv [Re: Rackscha] #406257
08/15/12 18:14
08/15/12 18:14
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline OP
Serious User
Rackscha  Offline OP
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
ah year got it working, stupid me:

1/16 is an integer division XD
it must be:

1.0/16.0

However, i noticed a problem with the texture filters. Imagine we have a dirttile on our sourcetexture and its surrounded by pure white. Now i place the uv quad on this tile.

In the engine, white very small stripes will occur between the tiles. Disabling filters helps, but sometimes a little white pixel pops up, not so noticeable but anoying.

I solved it, by correcting the uv quad position. Iam shrinking the quad by 0.001, which resolves the white line issue(even with enabled filters) but does not end in visible tiling. This seems to be a valid solution, anyone another idea or something why i shouldnt do this?


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