Line appears at the top of transparent texture (texture shifted?)

Started by 32kda, June 29, 2012, 08:59:58 AM

Previous topic - Next topic

32kda

Hi
Got a problem - created a poly (two triangles), used grass texture (transparent png) for it. When rotating camera up/down, black line sometimes appears at the top of "grass" poly. See http://prntscr.com/bajmq
Is it a result of inproper texture mapping (maybe line is actually bottom row of grass texture?) or smth other.
Size of texture is 512*128, size of poly is 4*1.
How to make texture to fit this poly properly?

EgonOlsen


32kda

Do you mean
Quote
texture.enableClamping();
?

It solved the problem, thanks alot.

EgonOlsen

No, i actually mean setClamping() as enableClamping() is deprecated...anyway, both do the same thing.... ;)

arianaa30

Egon,
I've a problem with a PNG texture, in which the background is transparent. in the game, the background gets black. What should I do?
attached is the grass texture!!!

[attachment deleted by admin]

EgonOlsen

You have to set some transparency by calling...setTransparency(0...x) on your grass objects. If the png contains an alpha channel, make sure to use the appropriate construtor or jPCT will ignore it and create it's own.

arianaa30

I'll test it. What if I make the background dark by myself?
the JPG rock texture looks good.

[attachment deleted by admin]