Help please

airam

24-01-2008 17:09:14

Hi all!

I continue with my problems with z-buffer.
I'd like to load this 2 objects like in the pictures





But I only obtain that the cone is seen in front of the box.

Is this possible with ogre Pocket PC. I have tested with SoftGL and Vincent Rende Systems, but I get the same result.

I was reviewing all tha code, also the ogre Pocket PC code, and the z-buffer is enabled... so...

If you have an example where it can be seen... could you help me?

Thanks in advance.

soongxl

26-01-2008 02:39:46

Maybe it is because the Fixed-point algriothm. I do not know the exact reason. One of my friends now is rewriting some key source code using 64bits Fixed-Point.

Or maybe Using Coco3D or some other soft pipeline will not suffer that point. Just maybe.

In the next long holidays, I will check the code to make sure the bug.

Hi all!

I continue with my problems with z-buffer.
I'd like to load this 2 objects like in the pictures





But I only obtain that the cone is seen in front of the box.

Is this possible with ogre Pocket PC. I have tested with SoftGL and Vincent Rende Systems, but I get the same result.

I was reviewing all tha code, also the ogre Pocket PC code, and the z-buffer is enabled... so...

If you have an example where it can be seen... could you help me?

Thanks in advance.

airam

29-01-2008 14:21:20

Hi all,

First, thanks for your help soongxl.

I have found a shoddy work to solve this problem.

I've enabled the z-buffer before load the objects


glClear(GL_DEPTH_BUFFER_BIT);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
Entity *ent1 = mSceneMgr->createEntity( "box", "box.mesh");
SceneNode *node1 = SceneMgr->getRootSceneNode()->createChildSceneNode( "box");
node1->attachObject( ent1 );
Entity *ent2 = mSceneMgr->createEntity( "cone", "cone.mesh");
SceneNode *node2 = mSceneMgr->getRootSceneNode()->createChildSceneNode( "cone");
node2->attachObject( ent2 );


At first it didn't work so I have decided not to enable z-buffer through Render System. So in OgreEGLRenderSystem.cpp (I have used Vincent Render System because in my opinion it works faster) I have the following code:


void EGLRenderSystem::_setDepthBufferCheckEnabled(bool enabled)
{
if (enabled)
{
//glClear(GL_DEPTH_BUFFER_BIT);
//glEnable(GL_DEPTH_TEST);
}
else
{
//glDisable(GL_DEPTH_TEST);
}
}
//-----------------------------------------------------------------------------
void EGLRenderSystem::_setDepthBufferWriteEnabled(bool enabled)
{
GLboolean flag = enabled ? GL_TRUE : GL_FALSE;
//glDepthMask( flag );
OGRE_GL_GETERROR("glError");
// Store for reference in _beginFrame
mDepthWrite = enabled;
}
//-----------------------------------------------------------------------------
void EGLRenderSystem::_setDepthBufferFunction(CompareFunction func)
{
//glDepthFunc(convertCompareFunction(func));
//glDepthFunc(GL_LEQUAL);
OGRE_GL_GETERROR("glError");
}

void EGLRenderSystem::_setDepthBias(ushort bias)
{
if (bias > 0)
{
//glEnable(GL_POLYGON_OFFSET_FILL);
}
else
{
//glDisable(GL_POLYGON_OFFSET_FILL);
//glEnable(GL_POLYGON_OFFSET_FILL);
}
}


I have commented the functions about z-buffer.

I've rebuild the Vincent Render System dll and now it works!! :)

But I don't understand why. :roll:

I would like to help to get a better solution, but It is so much code for me.
Any idea?

GenericBum

29-01-2008 19:36:46

HI airam,

I appreciate all your hard work on this. I've noted your alterations, and I'll go inspect the code for a better fix.

Thanks,
GenericBum