Open GL Render settings?

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
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

Open GL Render settings?

Post by Mloren »

Ok so I'm trying to do something a little odd.

I'm trying to use OpenGL draw functions with irrlicht.
The problem is that irrlicht seems to set its blend types based on what you draw and if you don't draw anything then they are wrong.

So in my case I am not drawing anything with irrlicht, I only draw with glBegin() calls and nothing appears on screen.
If I add one draw2DRectangle() call then suddenly all my OpenGl drawn stuff appears.
If the object drawn with draw2DRectangle() is fully opaque then all my OpenGL stuff is fully opaque as well (even though it has alpha data).
If I lower the alpha of draw2DRectangle() to less that fully opaque then all my OpenGL stuff draws with correct alpha as well.

How do I make irrlicht use the correct render settings?
Currently I'm getting around this by drawing a semi transparent rectangle where it can't be seen but that's a bit dodgy.
Mloren
Posts: 114
Joined: Mon Aug 07, 2006 2:30 am
Location: Australia
Contact:

Post by Mloren »

Oh just in case its unclear, this is an irrlicht question not an OpenGL question. I know how to set the blend modes in OpenGL but they don't seem to work with irrlicht. I think irrlicht sets these things and doesn't let you change them.

What I had before I added irrlicht to the project was:
glShadeModel(GL_SMOOTH);
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClearDepth(1.0f);
glEnable(GL_DEPTH_TEST);
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_LEQUAL);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);

But these don't seem to work with irrlicht
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

Just use the one_texture_blend material, where you can set these blend modes from within Irrlicht.
Post Reply