Possible to render objects in front of others?
Possible to render objects in front of others?
Hello,
I'm wondering if it is possible to render a 3d object in front of another 3d object no matter what the ZBuffer says. I tried disabling the ZBuffer material flag, it worked, however all the faces were inverted after that (as if that flag flips normals).
So I'm wondering if there is a way to force a 3d object on top of another... Multi-pass rendering? I don't know, some suggestions?
________
HEMP
I'm wondering if it is possible to render a 3d object in front of another 3d object no matter what the ZBuffer says. I tried disabling the ZBuffer material flag, it worked, however all the faces were inverted after that (as if that flag flips normals).
So I'm wondering if there is a way to force a 3d object on top of another... Multi-pass rendering? I don't know, some suggestions?
________
HEMP
Last edited by disanti on Sun Feb 27, 2011 11:11 pm, edited 1 time in total.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
That flag doesn't flip normals, but without ZBuffering the triangles rendered in an arbitrary order and not culled. So it is not "flipping" the normals but rendering all triangles on top of each other without regard for depth.
What you need to do is clear the ZBuffer such as via the following snippet of code...
--EK
What you need to do is clear the ZBuffer such as via the following snippet of code...
Code: Select all
device->getVideoDriver()->clearZBuffer();
Last edited by disanti on Sun Feb 27, 2011 11:11 pm, edited 1 time in total.
Darn it! It isn't working...
Sometimes it works and draws on top of everything... other times... well... it doesn't work!
________
Rambler american specifications
Code: Select all
// render delayed default objects
CurrentRendertime = ESNRP_SOLID_LAST;
DelayedSolidNodeList.sort(); // sort by textures
for (i=0; i<DelayedSolidNodeList.size(); ++i)
{
Driver->clearZBuffer();
DelayedSolidNodeList[i].node->render();
}
DelayedSolidNodeList.clear();
________
Rambler american specifications
Last edited by disanti on Sun Feb 27, 2011 11:11 pm, edited 1 time in total.
-
- Posts: 313
- Joined: Tue Nov 01, 2005 5:01 am
ZBuffer is still there... I don't really know how I can help anymore... I simply modified irrlicht to have another render state: ESNRP_SOLID_LAST, and I posted the code to render it. Everything else is in order.
________
Motorcycle Tires
________
Motorcycle Tires
Last edited by disanti on Sun Feb 27, 2011 11:11 pm, edited 1 time in total.
@Pazystamo: No transparency, dunno where you got that idea...
@Afecelis: I'm not using billboards... where did you get that idea?
@Afecelis: I'm not using billboards... where did you get that idea?
Last edited by disanti on Sun Feb 27, 2011 11:12 pm, edited 1 time in total.