image not working
image not working
Hi,
I have added a cross-hair jpg file to my gun node.The image is displaying. But there is background white-square also appearing.I want to remove the white square. Any idea how to fix this?
Thank in advance
I have added a cross-hair jpg file to my gun node.The image is displaying. But there is background white-square also appearing.I want to remove the white square. Any idea how to fix this?
Thank in advance
mind to give more info? or show some pictures to explain your problem.
My company: http://www.kloena.com
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
My blog: http://www.zhieng.com
My co-working space: http://www.deskspace.info
This is my code:
Code: Select all
ISceneNode crosshairnode = smgr.addBillboardSceneNode(camera, new dimension2df(1, 1));
crosshairnode.setMaterialType(E_MATERIAL_TYPE.EMT_TRANSPARENT_ADD_COLOR);
crosshairnode.setMaterialTexture(0, driver.getTexture("../media/cross.jpg"));
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false);
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_GOURAUD_SHADING,true);
//crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_ZBUFFER, false);
this wont work with transparency as long as you don't make a color key texture...gamerfan wrote:This is my code:Code: Select all
ISceneNode crosshairnode = smgr.addBillboardSceneNode(camera, new dimension2df(1, 1)); crosshairnode.setMaterialType(E_MATERIAL_TYPE.EMT_TRANSPARENT_ADD_COLOR); crosshairnode.setMaterialTexture(0, driver.getTexture("../media/cross.jpg")); crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false); crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_GOURAUD_SHADING,true); //crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_ZBUFFER, false);
try something like this:
Code: Select all
ITexture image = driver.getTexture("../media/cross.jpg");
driver.makeColorKeyTexture(image, position2d<s32>(0,0));
ISceneNode crosshairnode = smgr.addBillboardSceneNode(camera, new dimension2df(1, 1));
crosshairnode.setMaterialType(E_MATERIAL_TYPE.EMT_TRANSPARENT_ADD_COLOR);
crosshairnode.setMaterialTexture(0, image);
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false);
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_GOURAUD_SHADING,true);
//crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_ZBUFFER, false);
I mean in normal case you do this:
Code: Select all
driver->getTexture("../media/cross.jpg");
Code: Select all
driver.getTexture("../media/cross.jpg");
Code: Select all
ITexture* image = driver->getTexture("../media/cross.jpg");
driver->makeColorKeyTexture(image, position2d<s32>(0,0));
ISceneNode* crosshairnode = smgr->addBillboardSceneNode(camera, dimension2df(1, 1));
crosshairnode->setMaterialType(EMT_TRANSPARENT_ADD_COLOR);
crosshairnode->setMaterialTexture(0, image);
crosshairnode->setMaterialFlag(EMF_LIGHTING, false);
crosshairnode->setMaterialFlag(EMF_GOURAUD_SHADING,true);
//crosshairnode->setMaterialFlag(EMF_ZBUFFER, false);
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
Thank for your reply.I am using jdk1.6
This is my picture
I am not sure whether you can see this image
This is my picture
Code: Select all
http://www.flickr.com/photos/45746796@N05/4203071963/
location for cross.jpeg
Code: Select all
http://www.flickr.com/photos/45746796@N05/4203154803/
hmmm, maybe a problem with the jsdk ???
or it could be a mipmap problem, bc you're using a billboard node...
so you can also try to regenerate the mipmap levels:
if so then try dimensions with POT (eg 256x256 or 512x512)...
or it could be a mipmap problem, bc you're using a billboard node...
so you can also try to regenerate the mipmap levels:
Code: Select all
ITexture image = driver.getTexture("../media/cross.jpg");
driver.makeColorKeyTexture(image, position2d<s32>(0,0));
image.regenerateMipMapLevels();
ISceneNode crosshairnode = smgr.addBillboardSceneNode(camera, new dimension2df(1, 1));
crosshairnode.setMaterialType(E_MATERIAL_TYPE.EMT_TRANSPARENT_ADD_COLOR);
crosshairnode.setMaterialTexture(0, image);
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_LIGHTING, false);
crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_GOURAUD_SHADING,true);
//crosshairnode.setMaterialFlag(E_MATERIAL_FLAG.EMF_ZBUFFER, false);
is this the original size you're using (350 x 350) ???gamerfan wrote:location for cross.jpegCode: Select all
http://www.flickr.com/photos/45746796@N05/4203154803/
if so then try dimensions with POT (eg 256x256 or 512x512)...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
should I use any editor to do that else any sample code that is doing this?
However I found similar thread below:
http://irrlicht.sourceforge.net/phpBB2 ... +channel
But it looks like the issue is still there
However I found similar thread below:
http://irrlicht.sourceforge.net/phpBB2 ... +channel
But it looks like the issue is still there