2-layer texturing issue. Is Irrlicht's alpha totally broken?

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
mikademus
Posts: 7
Joined: Fri May 23, 2008 8:26 pm

2-layer texturing issue. Is Irrlicht's alpha totally broken?

Post by mikademus »

Previously I asked about that alpha-belnded geometry can write to the Z-buffer under under OGL but not under D3D. This is a problem, but one that will be rectified I've heard.

Now I've run into a second, and more serious snag. I'm loading multi-textured geometry. Using this requires the EMT_SOLID_2_LAYER material flag to be set. This material will allow alpha blending under D3D but not under OGL!

Since the app will also work for people w/o shaders, a shaders-only solution is not an option.

This means that I can't use the D3D driver because then the geometry will not be Z-ordered, and I can't use the OGL driver because then the second texture layer will not blended.

This to me seems a critical issue, and I can't help but get the feeling that Irrlicht's alpha management may be fundamentally b0rked and the framework might simply be unusable for serious projects.

I'm sorry if my working is harsh, but I've spend weeks on an Irrlicht codebase, and I'm not looking forward to porting everything to a new system...
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Well, the solid2material is not yet supported under OpenGL, which is also documented in the API docs. Basically only because it wasn't used anywhere, and the description was not exactly clear about how it should work. IIRC, some enhancements have been done in SVN, so it might work better already, but there's no reason why it shuldn't be fixed if someone can tell me what this material really should do...
The d3d problem can easily fixed in your version of Irrlicht by removing the zbuffer override in CD3DMaterialRenderer.h - simply remove these statements.
BlindSide
Admin
Posts: 2821
Joined: Thu Dec 08, 2005 9:09 am
Location: NZ!

Post by BlindSide »

hybrid wrote:CD3DMaterialRenderer.h
Incase the OP gets confused, hybrid meant to say "CD3D9MaterialRenderer.h" and "CD3D8MaterialRenderer.h" respectively. In the transparent material renders, the material's ZWriteEnable is forced in the OnSetMaterial method.

@mikademus

Its a solid material, so what is the issue with alpha blending exactly? Are you talking about the 2 texture layers? So in OGL if you have a transparent texture layer on top it wont show the one underneath?

Cheers
ShadowMapping for Irrlicht!: Get it here
Need help? Come on the IRC!: #irrlicht on irc://irc.freenode.net
Post Reply