.

.

3 Likes

wow cool

does it work?

and…how does it work?

yeah ok , what I meant was “How does it work in jME3”.

This would need to be called at some point by the renderManager in the culling process.



Anyway thanks for this contribution :wink:

Cool, very interesting! ^^

This patch doesn’t exactly do it correctly

It assumes objects close to the camera are rendered first, however this is not always the case.

It works for the teapot test because all meshes have the same material and so they take advantage of front-to-back sorting, in a more varied scene it will be inefficient.

The correct way of doing it is by rendering the terrain first, then doing the queries all at the same time, you wait for the queries to finish and whichever geometries passed the queries are rendered.



You could probably create another queue that is used for the occlusion queries, and then flush it at some point (e.g. after terrain). You then prevent the geometry from being rendered later on by checking the query.

1 Like

Yeah they are sorted according to the GeometryComparator, which in this case is the opaque one which sorts by material first.

1 Like

hi there an update for the current jme3 version?

@alrik said:
hi there an update for the current jme3 version?

oO

sorry, i mean: is there a new version of the occlusion culling script? because this one doesn’t work with the current jme3 version (several errors)