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
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
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
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.