Bug Texture

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
Insects
Posts: 7
Joined: Thu Oct 25, 2007 1:58 am

Bug Texture

Post by Insects »

Hi,

Here is the 'simple' code :

Code: Select all

guienv->addImage(
    driver->getTexture("./top-left.png"), 
    position2d<s32>(0, 0)
);
Here is the original picture :

Image

Here is the bug :

Image

Details : i'm using Irrlicht 1.4.1, with D3D9, the original picture is in png (198*376) without transparency.


Does anyone have an idea about this problem ?

Thanks in advance.
++
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Basically the texture coords are wrapping round; repeating instead of clamping.

You'll notice the undesired artifacts on the right and bottom sides are actually the same as their opposite sides.

Incidentally you should knows that you're probably better off using texture dimensions which are of a power of two (e.g. 16x32... 512x512 etc) as often a PC's graphics card will upscale them to the nearest power of two anyway which will cause nasty artifacts.

As for solving the wrapping problem i think you can change the texture's wrap mode from repeat to clamp somehow, not sure how tho!
Image Image Image
Insects
Posts: 7
Joined: Thu Oct 25, 2007 1:58 am

Post by Insects »

Thanks for the reply ;)

I know that using texture dimensions which are a power of two is much better.. But the fact is that i tried too and got the same problem.. :?

Can you give me an example of how to change a texture's wrap mode ?

thanks again
++
mk.1
Posts: 76
Joined: Wed Oct 10, 2007 7:37 pm

Post by mk.1 »

E_TEXTURE_CLAMP irr::video::SMaterialLayer::TexureWrap
Insects
Posts: 7
Joined: Thu Oct 25, 2007 1:58 am

Post by Insects »

:? From all i understood, changing a texture's wrap thanks to SMaterialLayer is possible only with an ISceneNode.. But i'm adding a texture from the gui environment so i can't do this stuff..

Anyway i found a 'solution', by setting to true setImageScale of my image. Not that i like scaling but sounds that no choice.

Thanks.
Post Reply