opengl texture loading with alpha threshold?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
deets
Posts: 8
Joined: Tue Feb 17, 2009 11:00 am

opengl texture loading with alpha threshold?

Post by deets »

I'm displaying a bunch of billboard-nodes. These come with a texture that has a very "sophisticated" alpha-channel.

However, the resulting images don't reflect this.

See

http://attomaaku.com/screenshot.png

and

http://attomaaku.com/blase_30.png

for the original.


The billboard node + material are created as follows:

Code: Select all

  _node = world._smgr->addBillboardSceneNode(0, core::dimension2d<f32>(_radius * 2, _radius * 2));
  _node->setMaterialFlag(video::EMF_LIGHTING, false);
  _node->setMaterialFlag(video::EMF_ZWRITE_ENABLE, false);
  _node->setMaterialType(video::EMT_TRANSPARENT_ALPHA_CHANNEL);
  _node->setMaterialTexture(0, _world._driver->getTexture(texture_path(_world._resourcePath, "blase_30.png")));
Any suggestions?
deets
Posts: 8
Joined: Tue Feb 17, 2009 11:00 am

Post by deets »

Ok, I found this:

http://irrlicht.sourceforge.net/phpBB2/ ... +threshold

So setting

Code: Select all

  _node->getMaterial(0).MaterialTypeParam = -1.0f; 
did the trick.

Is that somewhere documented?
hybrid
Admin
Posts: 14144
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

For Irrlicht 1.5 there is usually no need to change the parameter for high quality transparency, you can only improve the render performance by setting the values higher. If you use an older version of Irrlicht, you should set the value to 0.01f (negative values are nonsense).
Post Reply