[no bug]Texture transparency on DIRECT3D

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
mfortik
Posts: 8
Joined: Fri Jan 22, 2010 11:39 am
Location: Prague, Czech Republic

[no bug]Texture transparency on DIRECT3D

Post by mfortik »

I found problem with rendering texture with alpha channel using Direct3D driver. Visibility of transparent part of texture depends on distance between camera and billboard with this texture. This issue is only for Direct3D not for OpenGL.

Irrlicht Engine version 1.6
Microsoft Windows XP Professional Service Pack 3 (Build 2600)
Using renderer: Direct3D 9.0
NVIDIA GeForce GTX 295 nv4_disp.dll 6.14.11.9038

There is changed code of example 07.Collision_vc9:

Code: Select all

/** Example 007 Collision
main.cpp file line 171
*/

	// Add the billboard.
	scene::IBillboardSceneNode * bill = smgr->addBillboardSceneNode();
	//bill->setMaterialType(video::EMT_TRANSPARENT_ADD_COLOR );
	bill->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL );
	irr::video::ITexture* tex = driver->getTexture("../../media/woman_doctor_idle.png");
	//bill->setMaterialTexture(0, driver->getTexture("../../media/particle.bmp"));
	driver->makeColorKeyTexture(tex, core::position2d<s32>(0,0));
	bill->setMaterialTexture(0, tex);
...

There is source picture woman_doctor_idle.png:

Image

There are two results of Irrlicht rendering, first is longer distance and second is shorter distance from billboard:

Image
Image
randomMesh
Posts: 1186
Joined: Fri Dec 29, 2006 12:04 am

Re: Texture transparency on DIRECT3D

Post by randomMesh »

Maybe using a texture that is pot helps.
"Whoops..."
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, calling regenerateMipmaps will also solve this problem. Please read the API for proper function usage.
Post Reply