PagedGeometry v1.05 - High speed forest rendering

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Sun Feb 10, 2008 4:31 am

Is there a wrapping of Paged Geometry in C# ?
Currently there is no official C# port of PagedGeometry for general use, but you might check libraries like MOGRE or Ogre.net and see if they include PagedGeometry.

shadowslayer: Those errors seem simple enough to fix. I should be able to update the official version soon to eliminate these errors on Linux, after I merge Azathoth's Linux compatibility work with the current version.
0 x

shadowslayer
Gnoblar
Posts: 2
Joined: Sun Feb 10, 2008 2:37 am
Location: Poland - Cracow

Post by shadowslayer » Sun Feb 10, 2008 12:50 pm

Thanks for the reply, anyway i know it`s just a simple syntax error and i corrected it in my copy, but a bit of work for the community is never bad at all :) there`s also another thing to fix in 2 source files: for BatchedGeometry.cpp(line 60) and for impostorpage.cpp

/opt/ogre/PagedGeometry/source/ImpostorPage.cpp:288: error: reference to ‘uint’ is ambiguous
/usr/include/sys/types.h:153: error: candidates are: typedef unsigned int uint

after corrections latest PagedGeometry from ogreaddons cvs compiles and runs smoothly on Linux :D
This thing rocks!
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Sat Feb 16, 2008 6:38 pm

PagedGeometry v1.04 Released
- (Bug Fix) Fixed a problem where TreeIterator2D or TreeIterator3D would crash when PagedGeometry's internal tree grid contained an empty tile
- (Bug Fix) Fixed a problem where calling deleteTrees() would crash in certain conditions

I haven't merged the gcc linux fixes yet (so they aren't included in this release), but I hope to do so soon.
0 x

User avatar
mullencm
Gnoblar
Posts: 23
Joined: Sun Oct 30, 2005 8:38 pm

BUG???

Post by mullencm » Tue Feb 26, 2008 12:22 am

This is in the addtree call in treeloader3d.cpp

should there be a second check for pos.z not pos.x

Code: Select all

	//If the tree is slightly out of bounds (due to imprecise coordinate conversion), fix it
	if (pos.x < actualBounds.left)
		pos.x = actualBounds.left;
	else if (pos.x > actualBounds.right)
		pos.x = actualBounds.right;

	if (pos.z < actualBounds.top)
		pos.z = actualBounds.top;
	else if (pos.x > actualBounds.bottom)
		pos.z = actualBounds.bottom;
0 x
-chase

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Tue Feb 26, 2008 1:49 am

Thanks for spotting that. It's fixed in CVS now.

The next maintanance release of PagedGeometry (v1.05) is currently scheduled to be released May 1, 2008.
0 x

User avatar
mullencm
Gnoblar
Posts: 23
Joined: Sun Oct 30, 2005 8:38 pm

Post by mullencm » Tue Feb 26, 2008 1:50 am

no prob, I love this add-on.
0 x
-chase

User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Imposter's colors

Post by sjcomp » Tue Mar 04, 2008 4:34 pm

My impostors have different color from the static geometry. What could be a reason for that?
Image
I have a single directional light which casts light straight down and is pure white. I've checked the generated texture Imposter.XXXX... and they do look dark, but it's hard to judge.

Thanks.
0 x
Regards, Alexander. http://sjcomp.com

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Tue Mar 04, 2008 5:24 pm

Have you tried deleting the impostor image files to force them to be regenerated? If the lighting conditions changed and you haven't regenerated the impostors, they'll look different.

Also, this could be caused by mipmap "color bleeding". You might want to try setting different colors with ImpostorPage::setImpostorColor(). This generally should be set to the average color of your tree (usually a green of course).

If all else fails, I guess you could modify the impostor.xxxx.png files and manually change the color. I'm not sure why else they would be giving the incorrect color since it just uses Ogre to render them to a texture with the current scene settings.
0 x

User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Post by sjcomp » Thu Apr 03, 2008 3:37 am

JohnJ wrote: Also, this could be caused by mipmap "color bleeding". You might want to try setting different colors with ImpostorPage::setImpostorColor(). This generally should be set to the average color of your tree (usually a green of course).
Ok. I'll see if that works for me. Though in general there is more than one color visible in impostors.
JohnJ wrote: If all else fails, I guess you could modify the impostor.xxxx.png files and manually change the color. I'm not sure why else they would be giving the incorrect color since it just uses Ogre to render them to a texture with the current scene settings.
I might opt to that. Maybe we should add an option for the user to specify the location where impostor images must be saved/loaded from. As opposed to having everything in the bin directory.

Another question about materials used for batches. It looks like material of entities is changed (internal shaders are applied). This means that I can not apply my material to the objects. How should I treat materials for batched entities?

Thanks.
0 x
Regards, Alexander. http://sjcomp.com

Johno
Gnoblar
Posts: 2
Joined: Wed Apr 23, 2008 10:06 pm

Re: PagedGeometry v1.0 - High speed forest rendering

Post by Johno » Thu Apr 24, 2008 10:39 pm

JohnJ wrote: Download PagedGeometry SDK

PagedGeometry SDK v1.03 for Visual C++ .Net 2005 (8.0) - 1.65 MB
Why there are only headers? Where can i download full code (cpp files) ?
0 x

User avatar
sjcomp
Gnome
Posts: 315
Joined: Sat Apr 23, 2005 2:35 pm
Location: Dover, NH
Contact:

Re: PagedGeometry v1.0 - High speed forest rendering

Post by sjcomp » Thu Apr 24, 2008 11:05 pm

Johno wrote: Why there are only headers? Where can i download full code (cpp files) ?
You can get sources from the repository: http://ogre.cvs.sourceforge.net/ogre/og ... s/forests/
Read information on how to use CVS if you are not sure how to use it.
0 x
Regards, Alexander. http://sjcomp.com

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Fri Apr 25, 2008 12:59 am

Why there are only headers? Where can i download full code (cpp files) ?
The source files should be right under the "source" folder after you extract the zip. 1.03 is an old version though (I must have forgot to update this thread's download links), so maybe if you try again it will work. CVS is another way to get all the source, with the added benefit of getting the latest version (with all the bug fixes and new features).
Maybe we should add an option for the user to specify the location where impostor images must be saved/loaded from.
True, though it's usually just as easy to just move them from the bin folder into whatever media folders you want. The impostor autogeneration is meant more to be a convenience tool than an actual game engine feature that's used by the end user, but I guess it wouldn't hurt.
Another question about materials used for batches. It looks like material of entities is changed (internal shaders are applied). This means that I can not apply my material to the objects. How should I treat materials for batched entities?
The batch system does make a clone of your material internally to apply it's vertex shader, but that shouldn't matter because you can't change the materials of a batch after it's created anyway. What you do need to know about using custom materials on trees is this: If you use your own vertex shader, you'll need to manually integrate BatchPage's fade transition shader code into your own shader, since your shader will override PagedGeometry, and there's unfortunately no magical solution to combining shaders.

Also, keep in mind a little issue I've found: multitexturing with BatchPage using one set of UVs doesn't work correctly unless you write a pixel shader due to some issue with DirectX/Ogre and using a vertex shader without a pixel shader (and BatchPage has to use a vertex shader for fade transitions).
0 x

Seregvan
Gremlin
Posts: 167
Joined: Sat Dec 15, 2007 11:44 pm

Post by Seregvan » Wed Apr 30, 2008 8:48 am

I've found a bug in your code: function PagedGeometry::getBounds() is no working. Looking the code I didn't find any setBounds calls for this class. Later I found that when I use setInfinite() there are zero bounds. So, I think there should be getBounds() function in TreeLoader.
I don't know if anyone need this things, but I want to save PagedGeometry data and want to save it's parameters.
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Wed Apr 30, 2008 9:00 pm

If bounded mode is enabled (which is done by calling setBounds()), then getBounds() should return exactly the same boundary info you gave to setBounds(). If you're using infinite mode (which is the default mode, but can be explicitly enabled by calling setInfinite()), then getBounds() should be returning (0, 0, 0, 0). How is PagedGeometry::getBounds() not working for you?
0 x

Seregvan
Gremlin
Posts: 167
Joined: Sat Dec 15, 2007 11:44 pm

Post by Seregvan » Wed Apr 30, 2008 9:51 pm

Yeh, agree with you =) but I want to get bounds from TreeLoader3D. When I'm creating an instance of this class there are TRect bounds as the second parameter. So I just want to get this data when I'm saving my scene =) Sorry for my bad explanation =)
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Fri May 02, 2008 4:51 am

PagedGeometry v1.05 Released
- (Feature) TreeLoader2D and TreeLoader3D now support deleting a rectangular region of trees
- (Feature) Added PagedGeometry::reloadGeometryPages(), which allows circular and rectangular regions of geometry to be selectively reloaded
- (Bug Fix) Fixed memory leak in GrassLoader when multiple layers are used
- (Optimization) BatchPage no longer adds vertex colors when they're not needed
- (Update) TreeLoader2D and TreeLoader3D now provide functions to get the bounds that were set in the constructor
- (Update) Added a new example application - a forest scene, using artwork kindly provided by Christian Herzog (mr.Zog) from 3d-diggers.de

Screenshots of the new example:
Image Image Image Image Image

The new vegetation models, provided by Christian Herzog (mr.Zog) for PagedGeometry, and are free for everyone to use commercially or non-commercially!
This is a free give away from the 3D-Diggers.
You can use it in any project you want (commercial, non-commercial, etc.).
0 x

User avatar
chmod
Greenskin
Posts: 131
Joined: Tue Feb 25, 2003 10:33 pm
Location: Seattle, Washington USA

Post by chmod » Fri May 02, 2008 7:32 am

Nice damn work, JohnJ. Stunning visuals!
0 x

Seregvan
Gremlin
Posts: 167
Joined: Sat Dec 15, 2007 11:44 pm

Post by Seregvan » Fri May 02, 2008 9:16 am

Thx for fixing =) And Thx for new version, updating =)
0 x

bharling
Gremlin
Posts: 166
Joined: Fri Jun 30, 2006 1:04 pm

Post by bharling » Fri May 02, 2008 3:32 pm

Those new shots look absolutely stunning!

sadly, the precompiled examples dont seem to work, all the demos just crash with no error message. I checked the log and there's no exceptions in there that i can see. The previous batch of examples worked fine on the same system ( dual core 2.6, Geforce 8500GT ).

am going to try it on my other system tonight
0 x
Was here

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Fri May 02, 2008 4:30 pm

Hmm it's not working here either. The precompiled demos must be missing some files. I'll upload a new version as soon as I fix it.

Edit: Looks like the Ogre DLLs included with the precompiled examples were old. If you update them they should work fine - or you can wait until I finish uploading the fixed version.
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Fri May 02, 2008 4:46 pm

Ok, the new working version is up. Hopefully it will run without problems now.

I also reuploaded the SDK package because I forgot to update the examples solution file (it wasn't showing the latest example project).
0 x

Prezadent
Gnoblar
Posts: 18
Joined: Sat Feb 10, 2007 11:59 pm

Post by Prezadent » Sat May 03, 2008 2:25 am

Example 8 - Forest Demo.exe looks great! Nice work on the system and props to the modeler.
0 x

tzlaine
Gnoblar
Posts: 21
Joined: Mon Mar 27, 2006 5:51 am

Post by tzlaine » Wed May 21, 2008 8:56 pm

I've been working on a solar system-wide space combat system for a game I'm working on. We have asteroid belts in some orbits of some systems. Someone suggested to me that I check out PagedGeometry as a solution to the problem of having large numbers of identical objects (asteroids, in my case) in a scene.

My scenes will always be in space, not on a varying-height terrain, but I can't find any reason in the docs or this thread why PagedGeometry can't be used for a large number of similar items, regardless of the rest of the scene. If possible, I'd also like to use it to speed up rendering of large numbers of vessels in fleet fights too. Am I looking in the right direction, or is there a showstopper I should know about before I dive into implementation?
0 x

User avatar
JohnJ
OGRE Expert User
OGRE Expert User
Posts: 975
Joined: Thu Aug 04, 2005 4:14 am
Location: Santa Clara, California

Post by JohnJ » Thu May 22, 2008 4:04 pm

While PagedGeometry was designed for trees, it might be possible to use it for asteroid fields, but keep in mind the limitations:

- All objects managed by PagedGeometry are static - they cannot be moved dynamically without removing them from PagedGeometry and converting to a normal entity first (which would remove all of PagedGeometry's performance benefits).

- PagedGeometry partitions geometry using a 2D grid, along the X/Z axis by default. A space game requiring objects widely spread along the Y axis will not be efficiently rendered.

- PagedGeometry's impostor renderer was built to render trees and other terrain-based objects. Since the billboards are oriented towards the camera while assuming Y as "up", this may not look good in a full 3D world where there is no specific "up".

Regarding vessels in flight, PagedGeometry would absolutely not work, unless you intend for them to be totally static (fixed position and rotation). I'd recommend you research something like instancing instead for this.

Personally, I'd write a custom system for space objects like asteroids (and in fact that is what I am going to do for my space game), since PagedGeometry was really built with trees on a flat terrain in mind, from the very beginning. But if you think it's worth a try, it might work well enough for you needs, as long as your asteroid fields are relatively flat.
0 x

tzlaine
Gnoblar
Posts: 21
Joined: Mon Mar 27, 2006 5:51 am

Post by tzlaine » Thu May 22, 2008 7:33 pm

JohnJ wrote:- All objects managed by PagedGeometry are static - [snip]
Thanks for the reminder. I had read this in the docs but had forgotten it.
- PagedGeometry partitions geometry using a 2D grid, along the X/Z axis by default. A space game requiring objects widely spread along the Y axis will not be efficiently rendered.
I saw a post in this thread on this page:

http://www.ogre3d.org/phpBB2/viewtopic. ... &start=100

... that mentioned support being added for the up direction to be changed, for instance with +Z up. Is this not implemented?
- PagedGeometry's impostor renderer was built to render trees and other terrain-based objects. Since the billboards are oriented towards the camera while assuming Y as "up", this may not look good in a full 3D world where there is no specific "up".
Does this imply the need to use billboards (which I'm not necessarily against mind you), or will PagedGeometry handle small asteroid meshes as well?
Personally, I'd write a custom system for space objects like asteroids (and in fact that is what I am going to do for my space game), since PagedGeometry was really built with trees on a flat terrain in mind, from the very beginning. But if you think it's worth a try, it might work well enough for you needs, as long as your asteroid fields are relatively flat.
Certainly post something about this to keep us updated (if it's possible and legal, of course)!
0 x

Post Reply