Single pixel image returns black

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
ping-pong2012
Posts: 17
Joined: Mon Sep 17, 2012 8:54 pm

Single pixel image returns black

Post by ping-pong2012 »

If I load a 1x1 texture of a white pixel, it shows up as black if I call

driver->draw2DImage(white, core::position2d<s32>(5,5));

If I make it a 2x2 white rectangle is shows up fine.

It appears it's OpenGL related, as Burning's Video and the normal software renderer show up fine. I didn't try DX.
CuteAlien
Admin
Posts: 9809
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Single pixel image returns black

Post by CuteAlien »

Could be that your card doesn't like non power of two textures.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Re: Single pixel image returns black

Post by hybrid »

Although 1 is a power of two, at least mathematically. Moreover, the smallest mipmap is always 1x1, so it should be supported by all gfx cards. But I'm not sure, if we may have to disable mipmapping for 1x1 textures. Better chances are, that it's something completely unrelated, though. Guess we need a test case addition.
Mel
Competition winner
Posts: 2292
Joined: Wed May 07, 2008 11:40 am
Location: Granada, Spain

Re: Single pixel image returns black

Post by Mel »

I have tried using (not loading though) 1x1 textures, and everything goes well. I create a 1x1 texture, i lock it, then i write the 0xFFFFFFFF value to it, and unlock it, and the texture works perfectly, at least, under DX, i haven't tested it on GL, but the procedure shouldn't be any diferent for GL
"There is nothing truly useless, it always serves as a bad example". Arthur A. Schmitt
CuteAlien
Admin
Posts: 9809
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Single pixel image returns black

Post by CuteAlien »

Oops, Hybrid right as usual. That shouldn't be the problem.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply