Render a "full geometry" frame

LeTitoulet

26-02-2008 11:37:39

Hi JohnJ and congratulation for your great work !
i'm using PagedGeometry in my project for rendering a lot of vegetation in real time.
I display batched impostor of computed plant meshes (very loud meshes : 50->100 mo) on a large terrain, so i can navigate in real time into the scene.
But my problem is that i would like to render a single frame with "full geometry" plant meshes for a given camera position.
Actually, I compute this single frame by repacing the ImpostorPage by EntityPage ... but the graphical driver crash for a large amount of geometry...not surprising.
I think i should render entity one by one into a "back buffer" but is it possible and how ? Can you help me or advice me ?
Thanx

PS: Sorry for my bad english

JohnJ

26-02-2008 15:43:47

It may be possible to render the scene page by page onto a render texture by adjusting the camera frustum, loading what's visible, and rendering it. Unfortunately, PagedGeometry just can't do this as it is, and would require heavy modification and probably a lot of work.

Also, you mention using EntityPage. This has been taken out of PagedGeometry quite a while ago (in favor of BatchPage, which is faster and better currently). What version of PagedGeometry are you using?

LeTitoulet

26-02-2008 16:26:07

I'm using the CVS version and I get EntityPage from an older version.
I used EntityPage because the batching of my heavy meshes is crashing my graphic card.
I'm perhaps off-topic but did Ogre provide functions to load Entity one by one and render it into a texture to finally merge the result into a single texture thanks to the z-buffer? Is RenderQueue a solution ?
Thx

JohnJ

26-02-2008 16:47:58

I'm using the CVS version and I get EntityPage from an older version.
I used EntityPage because the batching of my heavy meshes is crashing my graphic card.

Ok, that makes sense.

I'm perhaps off-topic but did Ogre provide functions to load Entity one by one and render it into a texture to finally merge the result into a single texture thanks to the z-buffer? Is RenderQueue a solution ?
Using the z-buffer is a good idea (why didn't that occur to me :)). Ogre doesn't have any functions that I know of to do this automatically, but Ogre is very flexible: In Ogre you can use setClearEveryFrame() or something to disable the back buffer (and optionally the z-buffer) from being cleared. Then you could render the scene bit by bit, loading just what is needed for rendering each frame.

Here's how I'd try to do it (pseudocode):
List<Vector3> treePositions; //this could be a treeiterator from PagedGeometry

Hide PagedGeometry's scene node
renderOneFrame()
setClearEveryFrame(false)

Load tree entity
Create a scenenode and attach the entity to it

For pos = each Vector3 in treePositions
Position the scenenode at pos
renderOneFrame()
Next

Delete the scenenode
Delete the entity (if your done with it)

Done rendering - save it out or whatever now

setClearEveryFrame(false)


It would probably be pretty slow, and you might be able to improve efficiency by rendering more than one tree at a time, but hopefully this will solve your problem :).

LeTitoulet

27-02-2008 08:14:16

Thanks for your help JohnJ !
I will try to do that and i'll tell you if it works!
Thanks again.