Is Irrlicht can cut overlapped objects?

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.
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Is Irrlicht can cut overlapped objects?

Post by Chmel_Tolstiy »

I'm interesting in: is irrlicht not render objects that overlapped by some objects when we see from camera. I mean is there some kind of algorithm done? For example, we should stay flag that object (or it's boundary box) is not transparent, so during rendering engine skips objects that collide by this object.

Thanks.
night_hawk
Posts: 153
Joined: Mon Mar 03, 2008 8:42 am
Location: Suceava - Romania
Contact:

Post by night_hawk »

Search for Occlusion culling.
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

search in forum or in google?
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

There are two irrlicht projects implementing Occlusion Culling so you should be able to find them, one is further developed than the other, i think they're fairly usable...
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Chmel_Tolstiy wrote:search in forum or in google?
Yes, it's vitally important that you choose the right one, because the other leads to Certain Doom.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Minnek
Posts: 12
Joined: Sun Jul 06, 2008 3:40 am

Post by Minnek »

It's true, I'm currently having 100 health drained because I picked the Doom one. (kudos for being able to dereference this poorly-made reference.)

In seriousness, I'm looking into occlusion culling as well. If I find any definitive information through personal research, I'll either post it here or PM you - whichever seems like the better option at the time.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

JP wrote:There are two irrlicht projects implementing Occlusion Culling so you should be able to find them, one is further developed than the other, i think they're fairly usable...
Yes, I think you are referring to myself and Nadro's project. Or Nadro's and someone else's project, but it doesn't matter.

At any rate I would just like to say that Nadro's is definitely more useful, and further developed. He has a great base to start on. At any rate, you need to make use, of his wrapper around occlusion queries, and implement some more advanced algorithms if you want to yield any real results with occlusion queries. They cause great overhead, and thus aren't very useful unless you use a clever algorithm, as presented in GPU Gems 2 (available online), or you introduce occlusion culling frame lag.

My general thought was that a better solution, if you don't need fully precise and accurate occlusion culling results, would be to render into a 256x256 (or user configurable) render target, and use the occlusion queries on that. The chance of becoming fill-rate limited is decreased, and the drawing time is decreased as well.

Also another one I was thinking off was making use of the octree. Basically, you would, for all visible nodes, find how many objects are in it. The nodes would also be weighted by how close they are to the near clipping plane and bounding box size, as well. But anyways, you would project the specific octree node bounding box onto the scene to retrieve a roundabout number of how many fragments are occupied by it. That would be factored into the weight equation as well. Then after gathering the weights, you would gather a small subset of the nodes that are believed to be heavy occluders, and only use occlusion queries on those nodes.

I have never gotten around to implementing the algorithm, and I doubt I ever will, but I was just throwing ideas around for you to work with. The best recommendation I would have for you is to use Nadro's occlusion query implementation, and the GPU Gems 2 algorithm.
TheQuestion = 2B || !2B
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

Is Nardo project included 1.4.2 realese ? I still don't download it. I use 1.4.1. Or I should use his patch for update source (I'm not good in svn) ?
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

Chmel_Tolstiy wrote:Is Nardo project included 1.4.2 realese ? I still don't download it. I use 1.4.1. Or I should use his patch for update source (I'm not good in svn) ?
No it wasn't included in 1.4.2, but you should still update to 1.4.2 anyways. And yes, his project must be applied as a patch, or you could manually type everything in.
TheQuestion = 2B || !2B
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

I have a big troubles with patch. I tryed TortoiseSVN and patch.exe for update code. But always got errors like "patch seems outdate". I tryed "update to revison 1498" and the same result. I tryed patching code of 1.4.2 realese - and the same result. May be some one can mail to me patched code of needed files and then I update my code to 1655 revision.

Thanks. email: naxart@gmail.com
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

Chmel_Tolstiy wrote:I have a big troubles with patch. I tryed TortoiseSVN and patch.exe for update code. But always got errors like "patch seems outdate". I tryed "update to revison 1498" and the same result. I tryed patching code of 1.4.2 realese - and the same result. May be some one can mail to me patched code of needed files and then I update my code to 1655 revision.

Thanks. email: naxart@gmail.com
Or may be anyone can send to me patch for 1655 Revision. Thanks.
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

I have one more question. May be who better know Nardo's project can help me. Nardo's code likes this

Code: Select all

Query[current]->Issue( D3DISSUE_BEGIN );
				{
					for(int scurrent = 0; scurrent < QueryMesh[current]->getMeshBufferCount(); scurrent++)
						drawMeshBuffer(QueryMesh[current]->getMeshBuffer(scurrent));
				}
(function void CD3D9Driver::runAllQueries())
Is after this call zbuffer changed ? and if yes can I stay some flags for buffer don't change? I want to make a 3d-tree for boundboxes and at first test on it, and only when I get leafs of my tree I want to change z-buffer.

Thanks.
Halifax
Posts: 1424
Joined: Sun Apr 29, 2007 10:40 pm
Location: $9D95

Post by Halifax »

That doesn't show whether the z-buffer is enabled or not. Look for something like:

Code: Select all

d3dDevice->SetRenderState(D3DRS_ZENABLE, TRUE);
or something like that. Or you can look for the Irrlicht equivalent.
TheQuestion = 2B || !2B
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

Thanks for your help. I'm trying to use this.
Chmel_Tolstiy
Posts: 41
Joined: Mon Feb 11, 2008 3:06 pm

Post by Chmel_Tolstiy »

I'm trying to use:
pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, FALSE); - when I want just to test for visibility of BBox;
pID3DDevice->SetRenderState(D3DRS_ZWRITEENABLE, TRUE); - when I want to change zbuffer. Is it correct? I read documentation, and as I understood, it's right. But it does not work correctly.

D3DRS_ZENABLE stated to TRUE.

It culls objects, that really visible. :(
Post Reply