Raw opengl calls ??

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
kohaistyle
Posts: 2
Joined: Mon Oct 29, 2007 11:23 am

Raw opengl calls ??

Post by kohaistyle »

Hello all ...

I just got started with Irrlicht and i find it great, but i have a simple question:

Is it possible to mix Irrlicht pipeline ( which is ok for some fixed geometry ) and raw opengl calls ?
Is it possible to get rid of this plain ugly Irrlicht s3dvertex / drawIndexedTriangle interface ? i have tons of opengl codes, and adapt it to irrlicht pipeline is like hell.


Ah another question, concerning the rendering itself :
after reading numerous topics, it seems you can't send just raw geometry to irrlicht, you have to create a mesh, feed the mesh buffer with vertices / triangles, then call the render ... any Irrlicht virtuoso could shed some light on this ? am i right ?

Thx a bunch !
vi-wer
Posts: 93
Joined: Sun May 20, 2007 7:15 pm
Location: Germany
Contact:

Post by vi-wer »

After you've created an irrlicht device you can use any opengl call anywhere in your program, it shouldn't make any problems.
Is it possible to get rid of this plain ugly Irrlicht s3dvertex / drawIndexedTriangle interface
Well, there's also a function called drawVertexPrimitiveList but it's pretty the same. As long you don't want to use any other driver that opengl you can just copy your code to where drawPrimitves functions should be.
it seems you can't send just raw geometry to irrlicht,
There's no need to create meshbuffers or nodes but you still need vertices and indices to draw them using drawVertexPrimitiveList or any other draw primitives function. Just call it between beginscene and endScene is ok.
There are also some draw3D** functions for simple geometry like draw3DTriangle or draw3DLine.
kohaistyle
Posts: 2
Joined: Mon Oct 29, 2007 11:23 am

Post by kohaistyle »

hmm after some tests ( either before, between or after beginScene() / endScene() of irrlicht ), it seems gl calls never reach the render :(

if anyone has some sample, if could help save one life ( or mine indeed ^^ )

I'll try with the mesh buffer method, though i find it quite heavy for some dynamic geometry.

Thanx for your reply :)


EDIT : if anyone is wondering, it's for some metaballs code !
SwitchCase
Posts: 170
Joined: Sun Jul 01, 2007 11:41 pm
Location: Manchester, UK

Post by SwitchCase »

Perhaps if you edited the irrlicht engine, adding functionality using your opengl code, you could achieve what you want. Plus if you do a nice job you could share it with everyone else. ;)

Good luck.
vi-wer
Posts: 93
Joined: Sun May 20, 2007 7:15 pm
Location: Germany
Contact:

Post by vi-wer »

( either before, between or after beginScene() / endScene() of irrlicht ), it seems gl calls never reach the render
Could you post some example code of what you're doing. Me for example, I'm doing something like this to render primitives.

Code: Select all

    Device->getVideoDriver()->beginScene(false, false, video::SColor(0,255,255,255));
    glClear( GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT );
    glLoadIdentity();

    Device->getVideoDriver()->setTransform( video::ETS_PROJECTION, proj );


    glBegin( GL_POINTS );
    for( int i = 0; i<DepthSize.Width; ++i)
    {
        for( int i2 = 0; i2<DepthSize.Height; ++i2)
        {
            float depth = DepthInfoBuffer[DepthSize.Width*i2 + i];
            glVertex3f( (float)(i-(DepthSize.Width/2)),
                        (float)(i2-(DepthSize.Height/2)),
                        depth);
        }
    }
    glEnd();

    Device->getVideoDriver()->endScene();
If you'd like to see what I'm using this code for take a look at here.
Scorcher24
Posts: 8
Joined: Sun Oct 28, 2007 7:45 pm

Post by Scorcher24 »

Hmm, you should first select the Matrix and then reset it.
You are currentliy resetting the Matrix and then you select the Projection Matrix.
glClear( GL_DEPTH_BUFFER_BIT|GL_COLOR_BUFFER_BIT );
glLoadIdentity();

Device->getVideoDriver()->setTransform( video::ETS_PROJECTION, proj );
You never know what Matrix Irrlicht currently has selected.
That's what I would try.
rya.
Raedwulf
Posts: 62
Joined: Sat Aug 20, 2005 7:08 am

Post by Raedwulf »

SwitchCase wrote:Perhaps if you edited the irrlicht engine, adding functionality using your opengl code, you could achieve what you want. Plus if you do a nice job you could share it with everyone else. ;)

Good luck.
Yes.
Treat irrlicht either as a general purpose engine or a skeleton for a better engine (i.e. improving upon irrlicht's built in components) Its not recommended to use irrlicht as an engine and plaster opengl code on top :P. You need to have device-dependant api calls inside irrlicht :).
Post Reply