changing the way irrlicht does blending

Discuss about anything related to the Irrlicht Engine, or read announcements about any significant features or usage changes.
Post Reply
gfxstyler
Posts: 222
Joined: Tue Apr 18, 2006 11:47 pm

changing the way irrlicht does blending

Post by gfxstyler »

hi!

irrlicht's current way of doing blending and transparency really sucks in my opinion, it's so over-complicated.

in my 2d engine i implemented blending and transparency like this:

the complicated but more flexible way:

Code: Select all

sprite->getMaterial()->Source = render::BM_WHITE;
sprite->getMaterial()->Destination = render::BM_WHITE_MINUS_SOURCE_COLOR;
the easy way

Code: Select all

sprite->getMaterial()->BlendPreset = render::BP_ADD;
bot pieces of code are similar to irrlicht's EMT_TRANSPARENT_ADD_COLOR, except they don't handle transparency, which i handle like this:

Code: Select all

sprite->getMaterial()->Color.a = 0.123;


is there any chance irrlicht could be changed in a similar way? because for each material type you otherwise have to add a large ammount of code, and irrlicht also just provides add, why not divide, substract, multiply, .....


now to the alpha value changing problem:

if a texture has an alpha channel, it should be automatically use it. and if you then change the alpha value of the node/material itself, the node should have changed transparency, too.

im bad at explaining, but i hope you get my point.

see you! :)
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

You're referring to the 2D blending???
Image
gfxstyler
Posts: 222
Joined: Tue Apr 18, 2006 11:47 pm

Post by gfxstyler »

no, to the 3d one. but why not also use this for 2d.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

i have no clue what you are talking about then

the only blending irrlicht does in 3d is based off of the material you use. the 2d blending is not done at all.

i was assuming you meant to add features to control blending in another way, but i really have no clue what you mean
Image
gfxstyler
Posts: 222
Joined: Tue Apr 18, 2006 11:47 pm

Post by gfxstyler »

yes, i mean to add more features to it e.g. the stuff i talked about above.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Ok, I get it. That will take a lot of changes. RenderStates would need to be implemented into the engine, and then materials would need to setup those renderstates through that interface, rather than making direct calls into the 3d API like currently works.

Good luck with it :) In the game I write now, about the only material I use in the engine is the EMT_SOLID. Other than that, I just make my own materials using shaders. I think it would be more important to worry about shader interfaces, rather than increasing interfaces to the fixed function pipeline.
Image
Post Reply