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 » Tue Nov 13, 2007 4:29 pm

I have a 7800 GT and it doesn't run too fast. Most of the examples have a fairly fast camera movement speed, though, so maybe this is the problem (or are you referring to something else?) Example 7 has a slower camera so you can enjoy the scenery more :)

P.S. For all Mac users: You can download an experimental Mac version here:

http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5685

The PagedGeometry library itself is, of course, Mac/Linux/Windows compatible already, but the above download includes project files and examples that should be compatible with OSX.
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 » Tue Nov 13, 2007 5:04 pm

PagedGeometry v1.02 Released
- (Bug Fix) Fixed a bug in the core PagedGeometry code where calling reloadGeometryPage() would crash unless a PageLoader was assigned, which caused unwanted crashes with certain uses of TreeLoader

This is a minor bug fix, which solves the problem where the program would crash when adding trees to a TreeLoader2D/TreeLoader3D before that loader was assigned to a PagedGeometry object.
0 x

BSer
Halfling
Posts: 93
Joined: Fri Dec 23, 2005 8:46 pm
Location: Niskayuna, NY
Contact:

Post by BSer » Wed Nov 21, 2007 1:08 am

Excellent, and thanks for the strong contribution. Great addons such as this and the editable terrain addon (among others) really reinforce my choice to go with Ogre.

The videos look great, and smooth. I can't seem to get them that nice while being small files, using Fraps anyway. What capture program do you use, and are those videos real-time or is there an apparent speedup do to slower capture rate?

Thanks again.
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 Nov 21, 2007 1:50 am

Thanks :)

I use fraps for video capture. By default I think fraps captures at 25 FPS, which is really slow, so I usually like to select a higher rate like 60. All the videos are captured in real-time. Videos captured by fraps are always huge (~100 - 200 MB) due to no compression being used, but I use Windows Movie Maker to compress (and edit) them.

P.S. There have been reports of PagedGeometry conflicting with the Editable Terrain Scene Manager for some reason, so let me know if you have problems also. I'm going to download the ETSM and test, so hopefully I'll be able to reproduce (and solve) the problem soon.
0 x

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

Post by Prezadent » Thu Nov 22, 2007 4:55 am

JohnJ wrote:Videos captured by fraps are always huge (~100 - 200 MB) due to no compression being used
Fraps does have a slight lossy compression codec. Its impossible to use the later versions of Fraps without it. While this might be nice for some people to save some HD space, I dislike it greatly.
0 x

DenArbetslose
Gnoblar
Posts: 3
Joined: Wed Nov 28, 2007 10:53 am

Post by DenArbetslose » Wed Nov 28, 2007 10:57 am

We're using MOgre and would like to be able to compile this into a DLL (preferablly managed). We tried to change the configuration type from "Static Library (.lib)" to "Dynamic Library (.dll)" but the linker refuses to link the library. All we get is error messages like this (notice dllimport is the case in all errors)

Code: Select all

Error	1	error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Ogre::AxisAlignedBox::~AxisAlignedBox(void)" (__imp_??1AxisAlignedBox@Ogre@@QAE@XZ) referenced in function __unwindfunclet$??0PagedGeometry@@QAE@PAVCamera@Ogre@@M@Z$0	PagedGeometry.obj


Is there anyone that has been able to compile this into a dll?
Regards
The Swedes
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 Nov 28, 2007 4:30 pm

According to that error, PagedGeometry isn't compiling into a DLL because it can't find Ogre's AxisAlignedBox. Try adding Ogre.lib to the linker configuration and I think your problem will go away :)
0 x

DenArbetslose
Gnoblar
Posts: 3
Joined: Wed Nov 28, 2007 10:53 am

Post by DenArbetslose » Wed Nov 28, 2007 4:57 pm

Sadly it won't. I've added Ogre's lib-directory to the linker's lib path so that shouldn't be a problem. I actually have no idea why I'm getting this error since the linker has access to Ogre's libraries. Do you mind trying to compile it into a DLL and see if you have better success than me? I would really like to try this out in MOgre.
0 x

User avatar
vasil
Gnoblar
Posts: 17
Joined: Wed Sep 03, 2003 11:52 am
Location: Plovdiv Bulgaria
Contact:

Post by vasil » Wed Nov 28, 2007 5:07 pm

@DenArbetslose

You say that you added the OgreMain.lib directory to linker's path but did you added the OgreMain.lib to Linker->Input->Additional Dependencies?
0 x
excuse my bad English

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 Nov 28, 2007 5:31 pm

Sadly it won't. I've added Ogre's lib-directory to the linker's lib path so that shouldn't be a problem. I actually have no idea why I'm getting this error since the linker has access to Ogre's libraries. Do you mind trying to compile it into a DLL and see if you have better success than me? I would really like to try this out in MOgre.
Like vasil said, you'll need to add "OgreMain.lib" to Linker->Input->Additional Dependencies in addition to specifying Ogre's lib directory. If this doesn't work, I'll try to compile a DLL for you.
0 x

DenArbetslose
Gnoblar
Posts: 3
Joined: Wed Nov 28, 2007 10:53 am

Post by DenArbetslose » Wed Nov 28, 2007 7:19 pm

Got it to build properly, but since this is not written in CLI, I guess I'll have to write a wrapper DLL or equivalent... Do you know any shortcut?
0 x

planders
Gnoblar
Posts: 1
Joined: Wed Nov 28, 2007 7:44 pm

Post by planders » Wed Nov 28, 2007 7:49 pm

DenArbetslose wrote:Got it to build properly, but since this is not written in CLI, I guess I'll have to write a wrapper DLL or equivalent... Do you know any shortcut?
Actually, it won't matter at all if you write a wrapper since the source code is not written in managed code. You'd have to rewrite the entire project and make it compatible with MOgre (which will be a bit tedious, perhaps). I'd really like to use PG with MOgre aswell, so I hope there is someone willing to do this (or has done it already).

Or am I missing something?
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 Nov 28, 2007 8:31 pm

Got it to build properly, but since this is not written in CLI, I guess I'll have to write a wrapper DLL or equivalent... Do you know any shortcut?
I'm not very experience with managed / unmanaged code integration, but the only way I've found to integrate C++ code with C#/VB/etc. is to compile the C++ code into a DLL and call the DLL from the managed code with P/Invoke (this is what I assume you're trying to when you compile PagedGeometry into a DLL). I don't know of any other way to integrate a C++ library into a C#/VB/etc. project besides porting the entire thing, unfortunately.
0 x

Vectrex
Ogre Magi
Posts: 1266
Joined: Tue Aug 12, 2003 1:53 am
Location: Melbourne, Australia
Contact:

Post by Vectrex » Wed Nov 28, 2007 10:41 pm

The MOgre project has a utility to help wrap c++ to c# without pinvokes. I've never tried it but that's how Mogre is done and most of it is automatic.
0 x

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

Post by mullencm » Thu Nov 29, 2007 11:03 pm

What is the limitation of the scale var in addtree(). to me it seams that it might be 0.0 - 2.0.

My goal is to use a tree mesh with a height of 1.0 unit. Then in my code:

treeLoader->addTree(myEntity, position, yaw, scale);

so that scale will rescale my tree to a specific height
(ie scale=10.0 -> 10', scale=20.0 -> 20' ...)

when I use numbers > 2.0 I get odd results.

Any thoughts?
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 » Fri Nov 30, 2007 12:22 am

What kind of odd results are you getting? Do the impostors become misaligned to the actual trees, or are you just not getting the amount of scaling you want? I don't think there's anything limiting you to just 0.0 - 2.0 scale values, so this might be a bug.
0 x

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

Post by mullencm » Fri Nov 30, 2007 7:18 am

It seemed like an overflow. If the scale value became bigger than 2.0 the result would scale down the mesh to a very small size.

Example:
-My mesh is 1 unit tall, I scale it by 1.9 -> it becomes almost 2 units tall
-My mesh is 1 unit tall, I scale it by 2.1 -> it becomes ~0.1 units tall


My work around now is to make my mesh 100 units tall and scale it down.

Example:
-My mesh is 100 unit tall, I scale it by 0.05 -> it becomes 5 units tall
-My mesh is 100 unit tall, I scale it by .9 -> it becomes 90 units tall
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 » Fri Nov 30, 2007 10:46 pm

Ok, you're right - I forgot that TreeLoader2D and TreeLoader3D only work with scale values between 0 and 2 - they do this so the size can be packed into one byte.

I'm going to add a setMaximumScale() function, which should solve your problem.

Edit: Done. You can get the latest version with setMaximumScale() from CVS.
0 x

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

Post by mullencm » Fri Nov 30, 2007 11:30 pm

sweet deal...thanks

so you store the var as a unsigned 8bit int (0-255) then fit the scale value in that range. Good idea, I don't for see the need for more that 255 shades of scaling. In my app all of my vegetation (flowers, bushes, trees) would probably be scaled from ( 0.5' - 80'), that still gives me ~4" of resolution. Which seems good.

so you will do something like...

Code: Select all

setMaxScaleAmount(Ogre::Real maxScaleVar)
...
tree.scale = 255 * (scale / maxScaleVar);
...
scale = (maxScaleVar * tree.scale) / 255
very cool...

another thought would be to include a minScaleVar also. I am not sure of the situation (redwood forest?) but if I were to be scaling meshes from 1 unit to a range 700-900 units it would help the resolution issue. The change here would be from ~3.5units of resolution to ~0.8 units.

still probably not worth the trouble.
0 x
-chase

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

Post by mullencm » Fri Nov 30, 2007 11:31 pm

quick turn around...thanks
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 » Sat Dec 01, 2007 1:12 am

another thought would be to include a minScaleVar also. I am not sure of the situation (redwood forest?) but if I were to be scaling meshes from 1 unit to a range 700-900 units it would help the resolution issue.
Good idea. Done (check CVS :) )

Also in CVS are some new bug fixes. There were issues with the grass system when the entire PagedGeometry object was deleted then recreated (in the case of ending and starting a new game in some engines), all of which should now be fixed.

I hope to release 1.03 with all the new bug fixes soon, but there's still one confirmed bug to fix and two unreproducible bug reports that I'm waiting for responses from the reporters.
0 x

Domarius
Gnoblar
Posts: 6
Joined: Tue Jul 03, 2007 2:11 pm

Post by Domarius » Thu Dec 06, 2007 4:18 am

So I guess I'm the only Ogre fan on the planet who gets

"This application failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem."

for each .exe in the pre-compiled examples.

This computer at work has a GeForce 6600. I'll try it at home, maybe this computer has a problem. Though at home my specs are 1.8 gig CPU, and Radeon 9550.
0 x

kcbanner
Goblin
Posts: 208
Joined: Sat May 05, 2007 4:49 pm

Post by kcbanner » Thu Dec 06, 2007 5:02 am

Thats a really weird error, usually comes from not having the .net framework...but ogre doesn't use .net sooo...thats really weird :P
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 Dec 06, 2007 5:30 am

Domarius: That certainly is strange. Do any of Ogre's examples run on your computer?

It could it be that your computer doesn't have MS Visual C++ (or the VC++ redistributable) installed, and therefore doesn't have the libraries the EXEs need to execute (I didn't include the VC++ libraries in the precompiled examples because most users will be developers who already have them installed). Normally I'd assume you already have this installed, but I can't think of anything else it could be right now.
0 x

User avatar
lf3thn4d
Orc
Posts: 478
Joined: Mon Apr 10, 2006 9:12 pm

Post by lf3thn4d » Thu Dec 06, 2007 7:35 am

I think it's just that you didn't have the right version of direct X installed.
0 x

Post Reply