Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
Line appears at the top of transparent texture (texture shifted?)
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Line appears at the top of transparent texture (texture shifted?) (Read 4945 times)
32kda
byte
Posts: 10
Line appears at the top of transparent texture (texture shifted?)
«
on:
June 29, 2012, 08:59:58 am »
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?
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #1 on:
June 29, 2012, 10:57:21 am »
try
Code:
[Select]
<grassTexture>.setClamping(true);
Logged
32kda
byte
Posts: 10
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #2 on:
June 29, 2012, 03:49:13 pm »
Do you mean
Quote
texture.enableClamping();
?
It solved the problem, thanks alot.
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #3 on:
June 30, 2012, 12:21:39 am »
No, i actually mean setClamping() as enableClamping() is deprecated...anyway, both do the same thing....
Logged
arianaa30
byte
Posts: 44
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #4 on:
July 03, 2012, 11:39:09 pm »
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]
Logged
EgonOlsen
Administrator
quad
Posts: 12297
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #5 on:
July 03, 2012, 11:41:20 pm »
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.
Logged
arianaa30
byte
Posts: 44
Re: Line appears at the top of transparent texture (texture shifted?)
«
Reply #6 on:
July 03, 2012, 11:55:06 pm »
I'll test it. What if I make the background dark by myself?
the JPG rock texture looks good.
[attachment deleted by admin]
Logged
Print
Pages: [
1
]
Go Up
« previous
next »
www.jpct.net
»
jPCT-AE - a 3d engine for Android
»
Support
»
Line appears at the top of transparent texture (texture shifted?)