[help] Problem sizing Meshdecals

Maxi

17-11-2007 01:18:07

Hi

I want to use a meshdecal to highlight the terrain that is currently selected by the mouse pointer.

Here is the code to create the decal:


int size = 0;
Ogre::NameValuePairList params;
params["materialName"] = "terraineditor/cursor";
params["width"] = Ogre::StringConverter::toString( size );
params["height"] = Ogre::StringConverter::toString( size );
params["sceneMgrInstance"] = this->m_OgreSceneManager->getName();
this->m_BrushDecal = this->m_OgreSceneManager->createMovableObject("BrushDecal", "PagingLandScapeMeshDecal", &params);


Setting width and height to zero results in a meshdecal that covers exactly one square of the terrain (defined by 4 vertices); size values of 1, 2, 3, 4, ... have the effect that I can't see the decal at all. Values of 128, 256 will result in a very large, probably correct sized decal.

If I move the mouse arround on the terrain the 1x1 decal is relocated properly, but on some positions of the terrain the size suddenly changes to something like 16x16.
Moving a large (256x256) decal arround seems to have some delay because the shape of the decal is not updated.

I found no instructions explaining the exact use/behavour of meshdecals, so it would be nice if someone could tell me what I'm doing wrong.
Using a size of 0 looks very strange to me, so I think I missed something concerning scaling.



This is the decal as it should look like for my smallest brush


This is the above decal on another mouse position; sizing seems to depend on the distance to (0,0,0)


Here you can see the lag while using a large decal


- Ogre latest stable cvs + PLSM2 cvs
- material defines "depth_bias 1"
- heightmap size = 513, no scaleing aplied
- only one page