Post Useage Report. Some feature requests, bugs, annoyances

grizzley90

04-01-2008 19:04:09

Hi,
I have been using the PagedGeometry Engine in my own application and I would simply like to give a report from a client perspective. There are a couple of feature requests and some annoyances that I encountered while using the Paged Geometry Engine.

1. The setHeight Function does not allow function member pointers but only pointers to static functions. I am unsure if its just me not knowing how to use it but it does seem to me that only __thiscall functions are accepted. It would be great if you could use something like boost or fastdelegate to allow class function member pointers.

2. Density Map for grass only supports black and white, unless I am wrong? It would be nice if it was possible to use a heightmap style density map, where we could specify the density by the grayscale color.

3. Why can't you delete a grass layer? Destructor is private?

4. I am having problems with OpenGL and the ATI X1950 Radeon video card. The demos work as expected with the DirectX system but with OpenGL I get this:



5. This is probably an easy fix but how do you enable lighting on the textures? I am using Caelum for global illumination and at night I get something like this:

JohnJ

07-01-2008 16:01:37

1. The setHeight Function does not allow function member pointers but only pointers to static functions. I am unsure if its just me not knowing how to use it but it does seem to me that only __thiscall functions are accepted. It would be great if you could use something like boost or fastdelegate to allow class function member pointers.
It's true that only static functions work, but I've never needed to use anything like "__thiscall" - just any plain non-method function should work.

2. Density Map for grass only supports black and white, unless I am wrong? It would be nice if it was possible to use a heightmap style density map, where we could specify the density by the grayscale color.
It should support any shade of gray you want. Have you tried Example 7? The grass there uses a grayscale grass density map, and works fine for me. Not only does the grass system support greyscale density maps, but it also optionally supports bilinear filtering of the density and color map.

3. Why can't you delete a grass layer? Destructor is private?
Originally the grass system was designed as a [build-once, use, delete] style object, so there was no reason to delete grass layers individually during run-time. However, being able to delete grass layers would be very important for editors, so I'll try to add that feature.

Edit: I just added GrassLayer::deleteLayer(). You can get the latest version from CVS.

4. I am having problems with OpenGL and the ATI X1950 Radeon video card. The demos work as expected with the DirectX system but with OpenGL I get this:
I can't be sure, but it looks like a general Ogre problem with OpenGL on your computer. Everything seems to be messed up (not only PagedGeometry's trees and grass, but Ogre's terrain as well). Do all of the Ogre demos work under OpenGL for you?

5. This is probably an easy fix but how do you enable lighting on the textures? I am using Caelum for global illumination and at night I get something like this:
Actually this isn't such an easy fix. Currently PagedGeometry does not support any dynamic lighting, so achieving dynamic lighting usually requires modification of the engine. Modifying the grass system to support dynamic lighting actually wouldn't be that hard, but you'd have to add dynamic lighting to the tree system also, which wouldn't be as easy. I plan to eventually support "proper" dynamic lighting in PagedGeometry, but unfortunately it just isn't at that stage yet.

grizzley90

09-01-2008 02:11:09

Bugs!

It seems that if your mesh file is in a folder like Tree/Tree1.mesh, the paged geometry engine will try to create the imposter texture with the name including the slash which causes a crash on windows. It should be an easy fix, just strip the slash and replace with a . or something else.

Also, I don't know what the problem is but when I approach my tree it fails saying "BatchedGeometry can't use meshes with vertex data". How do I fix this?

JohnJ

09-01-2008 23:35:16

It seems that if your mesh file is in a folder like Tree/Tree1.mesh, the paged geometry engine will try to create the imposter texture with the name including the slash which causes a crash on windows. It should be an easy fix, just strip the slash and replace with a . or something else.
Nice find, I'll try to fix this soon.

Also, I don't know what the problem is but when I approach my tree it fails saying "BatchedGeometry can't use meshes with vertex data". How do I fix this?
This is something I'm working on - the BatchedGeometry class doesn't work with shared vertices due to the way they work. I need to add the code to handle shared vertices like Ogre's StaticGeometry does (I could probably fix this quickly if I could copy-n-paste Ogre's code, but unfortunately that would "infect" my project with LGPL).

Jules Robichaud Gagnon

10-01-2008 21:57:17

1. The setHeight Function does not allow function member pointers but only pointers to static functions. I am unsure if its just me not knowing how to use it but it does seem to me that only __thiscall functions are accepted. It would be great if you could use something like boost or fastdelegate to allow class function member pointers.

It would not be too hard to patch the tree loader to support member functions

change :
Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z);
for :
Ogre::Real (*heightFunction)(Ogre::Real x, Ogre::Real z, void * data);

Change "setHeightFunction" function and to receive an extra data "void * data = NULL".

Add a void * mData; member initialised to NULL to TreeLoader2D and set it with the "data" received with setHeightFunction.

When the loader calls the heightFunction, you add the mData to the function instead of just x and y.

Your class with a function to call needs a static and non static member function like :


float myClass::foo( float x, float y)
{
// do stuff
return value;
}

static float myClass::fooWrapper( float x, float y, void * data )
{
return ((myClass*)data) ->foo( x, y);
}

Jules Robichaud Gagnon

10-01-2008 21:59:51

This way the loader supports both member and non-member functions.

syedhs

10-01-2008 22:09:07

Simple fix for night scene: supply a lightmap texture which is almost black (up to your taste) and the grass will blacken properly.

JohnJ

14-01-2008 18:26:29

Jules Robichaud Gagnon: That seems like a good idea. I'll add support for a userdata parameter in the next release.

syedhs: Yeah, that should work, although not so much if the lighting changes a lot dynamically.

Jules Robichaud Gagnon

14-01-2008 18:36:37

Jules Robichaud Gagnon: That seems like a good idea. I'll add support for a userdata parameter in the next release.

At your service JohnJ. 8)

nortsen

06-02-2008 23:31:39

Hi,

I have the same problem with OpenGL like grizzley90.
The Ogre OpenGL demos runs well. My card is an Ati x800.

JohnJ

07-02-2008 04:07:51

The fact that even the tree trunks (which should be using a very simple vertex shader) are appearing incorrectly seems to indicate a shader issue, which seems to be fairly common with ATI and OpenGL. I'm not sure if it's driver issues, but it appears to be the case (OpenGL works fine on my GeForce card). Does DirectX seem to work (or are you using linux/mac)?

It's also strange that the trees are being correctly fogged, while Ogre's terrain is not. Does Ogre's terrain example work with fog? Maybe Ogre just isn't working with OpenGL for you at all.

nortsen

07-02-2008 21:16:56

Hi JohnJ,

Does DirectX seem to work (or are you using linux/mac)?

I’m using windows xp and with directx works perfectly.


It's also strange that the trees are being correctly fogged, while Ogre's terrain is not. Does Ogre's terrain example work with fog? Maybe Ogre just isn't working with OpenGL for you at all.


I tried the terrain with fog and in opengl works well but only if VertexProgramMorph=no.
If it’s yes the terrain is white like grizzley90's.

Jules Robichaud Gagnon

07-02-2008 21:22:02

What render queue is the terrain? Have you tried to change the render queue of the terrain of an earlier one?

It is a pure guess.