1 (edited by Queller 2007-09-08 02:09:06)

Topic: driver.makecolorkeyTexture(texture, _POSITION2DI(x,y)) problem

Hi! I am trying to load in a bitmap and put it on a billboard. I have selected a mask colour, (255,0,255) - that disgusting pepto-bismol colour...

Anyway, I go ahead and load the texture and try to mask away the pepto using driver.makecolorkeyTexture(mytex, _SCOLOR(0,255,0,255)). Now this didn't mask the color and the texture did not display on the billbaord at all. I just get a black square. I'll get that later. For now, I am trying to figure out the masking problem.

To test things, I applied the texture to a terrain scene node and it painted it perfectly fine, but still not masked.

So after consulting the Irrlicht manual for clues, they say because of colour conversion issues it is sometimes better to sample a pixel of the colour you wish to mask from a known point on the texture, using driver.makecolorkeyTexture(texture, _POSITION2DI(x,y)).

Alright, so I tried driver.makecolorkeyTexture(mytex, _POSITION2DI(0,0)) because that colour is definitely at (0,0). The thing that finally made me ask for your help is that driver.makecolorkeyTexture(texture, _POSITION2DI(0,0)) absolutely insists on taking an _SCOLOR as its parameter, not _POSITION2DI or _POSITION2DF.

What can I do to achieve the masking in this manner? Once this is out of the way I can move on to why the billboard isnt doing what its suppose to big_smile


So I solved the black billboard issue and the masking issue. You have to really make sure to set the billboard to setMaterialFlag(EMF_LIGHTING, False) if you dont have dynamic lights yikes

Also, the masking issue was not Irrlicht but something weird with the art program I used, which altered colour (255,0,255) to (255,15,255) so Irrlicht was doing what is was supposed to. I just told it the wrong colour sad

Anyway, should I need to create a mask colour from a sample pixel on a texture, how would I do it? Irrlicht still refuses to accept that _POSITION2D argument to do what the manual says.


Re: driver.makecolorkeyTexture(texture, _POSITION2DI(x,y)) problem

greetings Queller smile  glad you were able to get your problem resolved.  you can use a pixel to create the mask.  the problem is that BlitzMax doesnt allow method overloading so each overloaded method became a new method.  in the mod, what you are lookingfor is driver.makeColorKeyTextureFromPixel().