[SOLVED] error using grass (shader)

luis

25-07-2008 15:46:47

Hi, i'm trying to use grass in my application, I copy-paste the setup code from Example4, grass2.png and grass.material to my media folder but I'm getting this error:

16:35:45: Mesh: Loading wildcatmonster_wheelr.mesh.
16:35:45: Texture: smoke4.png: Loading 1 faces(PF_A8R8G8B8,64x64x1) with hardware generated mipmaps from Image. Internal format is PF_A8R8G8B8,64x64x1.
16:35:47: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 873)
16:35:52: *-*-* OGRE Shutdown
16:35:52: *-*-* OGRE Shutdown
16:35:52: Unregistering ResourceManager for type Compositor

I'm using 1.05v from zip and Example4 works fine in my PC but I cant make it work in my app...
this is my setup code:

//-------------------------------------- LOAD GRASS --------------------------------------
//Create and configure a new PagedGeometry instance for grass
Camera *cam = mSceneMgr->getCamera( GBGlobals::CAMERA_NAME );
mGrass = new Forests::PagedGeometry(cam, 50);
mGrass->addDetailLevel<Forests::GrassPage>(70);
//Create a mGrassLoader object
Forests::GrassLoader *gloader = new Forests::GrassLoader(mGrass);
mGrass->setPageLoader(gloader); //Assign the "treeLoader" to be used to load geometry for the PagedGeometry instance

//Supply a height function to mGrassLoader so it can calculate mGrass Y values
//gloader->setHeightFunction(&Track::getHeightAt2);

//Add some mGrass to the scene with mGrassLoader::addLayer()
Forests::GrassLayer *l = gloader->addLayer("grass");

//Configure the mGrass layer properties (size, density, animation properties, fade settings, etc.)
l->setMinimumSize(2.0f, 0.5f);
l->setMaximumSize(2.5f, 1.0f);
l->setAnimationEnabled(true); //Enable animations
l->setSwayDistribution(10.0f); //Sway fairly unsynchronized
l->setSwayLength(0.5f); //Sway back and forth 0.5 units in length
l->setSwaySpeed(0.25f); //Sway 1/2 a cycle every second
l->setDensity(1.5f); //Relatively dense mGrass
l->setFadeTechnique( Forests::FADETECH_GROW ); //Distant mGrass should slowly raise out of the ground when coming in range
l->setRenderTechnique( Forests::GRASSTECH_CROSSQUADS ); //Draw mGrass as scattered quads

//This sets a color map to be used when determining the color of each Grass quad. setMapBounds()
//is used to set the area which is affected by the color map. Here, "terrain_texture.jpg" is used
//to color the Grass to match the terrain under it.
l->setColorMap( "pecos_stress_terrain.jpg" );
l->setMapBounds( Forests::TBounds(0, 0, 140, 140) ); //(0,0)-(1500,1500) is the full boundaries of the terrain

After creating the grass I'm also using Ogre::StaticGeometry for my trees could it be the reason for this exception ?

luis

25-07-2008 20:32:46

I had the Plugin_CgProgramManager commented in Plugins.cfg ! :oops:
It's working now, veery slow I'll try changing parameters....