Game Development Community

2D objects in torque

by varmint · in Torque Game Engine · 09/03/2002 (11:07 am) · 4 replies


#1
09/03/2002 (11:07 am)
Dean,

I've not looked at your code but it looks very much like your texture coordinates are larger than 1 and the texture is in GL_CLAMP mode.

I'm not sure of your intentions here but perhaps you should look at your render code and ensure that the coordinates are in the range of 0->1.

- Melv.
#2
09/03/2002 (11:40 am)
Dean,

I just tried your code and it works fine without the problem you show. Have you tried other textures, perhaps the ones that come with Torque like 'water' or something?

Just one other note, if it's just a simple billboard effect you want then there is literally buckets of code you can strip out of this object.

- Melv.
#3
09/03/2002 (12:19 pm)
Moreover if you only need billboard you can also create a dts object with the billboard attributes and put a static object in your map with this dts.
#4
09/04/2002 (11:37 am)
Dean,

Ah, all becomes clear now. Your texture dimensions *must* be a power of 2. All graphics cards are optimised for these sizes. There are certain features available on cards that allow non-power-of-2 dimensions but those come at the cost of disallowing other features such as mip-mapping but I digress.

Try textures with dimenions of 2,4,8,16,32,64,128,256 or 512. Don't forget, they don't have to be square but each axis must be of one of the previous dimensions.

- Melv.