Correction for OpenGL on MacOS 10.6

andrijapetrovic1

27-06-2010 14:26:25

_getDensityAt_XXX methods of the DensityMap compensate for an error in OpenGL mode:


//Patch incorrect PixelBox::getWidth() in OpenGL mode
if (Root::getSingleton().getRenderSystem()->getName() == "OpenGL Rendering Subsystem")
--mapWidth;


I am hereby reporting that such an error does not exist on OpenGL on MacOS 10.6. When a rectangle is populated with Grass in Ogitor, here is what a user gets if the patch above is active:
[attachment=2]tilted.png[/attachment]
The light-blue rectangle is the Grass brush, and the Grass is populated not within the needed rectangle. The population rectangle "leans" to the left (x decreases when z increases).

At the moment I cannot prove the existence of this error on other platforms, so I propose the following patch for the existing patch:


#if OGRE_PLATFORM != OGRE_PLATFORM_APPLE
//Patch incorrect PixelBox::getWidth() in OpenGL mode
if (Root::getSingleton().getRenderSystem()->getName() == "OpenGL Rendering Subsystem")
--mapWidth;
#endif


So you get to

[attachment=1]rectangular.png[/attachment]

In addition to this visual correctness of my argument, I also see that my PixelBox reports the width and height correctly (1024x1024 pixels), so there is really no need for this --mapWidth compensation.

I hope I'll test the code myself on Windows and Linux as well...

Cheers,
Andrija

Fish

27-06-2010 21:44:38

Can you post the parameters that you used to set up your grass layers including page_size, render_technique, bounds, sizes of the grass billboards, density, and fade_technique. Also, which version of Ogre are you using? I assume it's 1.7.1 but I seem to recall reading somewhere that Ogitor might be using 1.8. Video card make and model may also be helpful.

The place to post patches is: http://redmine.rigsofrods.org/projects/pagedgeometry otherwise they will get lost in the forums.

Thanks,

- Fish

andrijapetrovic1

28-06-2010 12:18:31

Here are the params (I hope I got them right):

page_size: 40
bounds: {left:-256,top:-256,right:256,bottom:256}
technique: GRASSTECH_CROSSQUADS
fade_technique: FADETECH_GROW
density: 3
grass billboard size: 1
density map size: 1024x1024

Ogitor version is 1.7.1
OS: Mac OS X 10.6.4
Video card:
Chipset Model: GeForce 8600M GT
Type: GPU
Bus: PCIe
PCIe Lane Width: x16
VRAM (Total): 256 MB
Vendor: NVIDIA (0x10de)
Device ID: 0x0407
Revision ID: 0x00a1
ROM Revision: 3212

I'll post the patches at http://redmine.rigsofrods.org/projects/pagedgeometry, together with the data above.

Thanks,
Andrija