Grass Problems on Linux

SumnerH

05-02-2008 07:05:29

I've just built PagedGeometry on my Linux machine, and 5 of the examples are running fine. If I try to run Example4 or Example7, though, I'm getting:

"terminate called after throwing an instance of 'Ogre::InvalidParametersException'
what(): OGRE EXCEPTION(2:InvalidParametersException): This pass does not have a vertex program assigned! in Pass::getVertexProgramParameters at OgrePass.cpp (line 1106)"

which is being thrown from within GrassLoader::frameUpdate

Has anyone gotten grass loading working on Linux? I'm a good C programmer and can muddle my way through C++ well enough if anyone's got an idea where to start hunting.

Thanks for the cool code, John, the tree stuff is working quite well already!

EDIT: This is with both 1.0.3 and current CVS versions of PagedGeometry. I'm running Debian unstable Ogre packages (1.4.5) on Ubuntu with a Radeon Mobility X1600 with the fglrx binary drivers.

JohnJ

05-02-2008 15:36:36

Ok, thanks for reporting. I'll check it out (even though I'm not running Linux, I may be able to spot possible problems in the code causing the problem).

SumnerH

05-02-2008 18:57:29

Ok, thanks for reporting. I'll check it out (even though I'm not running Linux, I may be able to spot possible problems in the code causing the problem).

Thanks. Let me know what I can do to help, be it testing or coding.

I'm starting to become a bit suspicious about shader support in the Linux ATI drivers but I don't have anything solid just yet.

ssross

06-02-2008 04:41:30

I have been playing with this in Linux (Fedora7) using the nvidia drivers and it is working for me. In particular I have been hacking on Example7 from v1.03 to learn how to make use of PG without any problems.

ssross

06-02-2008 15:30:15

Another thought; make sure that you are loading the libraries that you think you should. On my system I can run 'ldd ./Example7' and get a list of 46 libraries. Pay most attention to where the Ogre, PagedGeometry and Cg libraries come from. I had a similar problem (different symptom) because another package had registered a back-rev version of Cg into the global library search path. For the 1.4.6 version of Ogre you need the 2.0 version of Cg.
- scott

JohnJ

06-02-2008 21:51:16

I think the "This pass does not have a vertex program assigned!" error is probably triggered from this line (line 96, GrassLoader.cpp):
GpuProgramParametersSharedPtr params = layer->material->getTechnique(0)->getPass(0)->getVertexProgramParameters();

It's trying to update the grass shader which should have been applied, and for some reason maybe it didn't get applied.

Could you put a breakpoint in GrassLayer::_updateShaders() where it calls "pass->setVertexProgram(vsName);" (line 1074) and see if it actually does apply a shader? If not, there may be a bug in PagedGeometry preventing the shader from being applied. If it does apply it, I'd suspect a Ogre/OpenGL/driver issue since normally the shader should be applied without any problems.

SumnerH

06-02-2008 23:51:50

I think the "This pass does not have a vertex program assigned!" error is probably triggered from this line (line 96, GrassLoader.cpp):
GpuProgramParametersSharedPtr params = layer->material->getTechnique(0)->getPass(0)->getVertexProgramParameters();

It's trying to update the grass shader which should have been applied, and for some reason maybe it didn't get applied.

Could you put a breakpoint in GrassLayer::_updateShaders() where it calls "pass->setVertexProgram(vsName);" (line 1074) and see if it actually does apply a shader? If not, there may be a bug in PagedGeometry preventing the shader from being applied. If it does apply it, I'd suspect a Ogre/OpenGL/driver issue since normally the shader should be applied without any problems.


I've just updated to a newer version of the ATI driver and now these demos are running. So looks like it was a driver issue. Sorry for the waste of time.

Grass is looking nice now! Well, it's looking like the odd OpenGL ATI grass in the "Post Useage Report. Some feature requests, bugs, annoyances" thread, but that's within expectations. Thanks for a great piece of software.

JohnJ

07-02-2008 03:56:33

So looks like it was a driver issue.
Ok, I kind of suspected that.

Too bad the grass isn't showing up properly though. The grass seems to have a lot of problem with OpenGL & ATI. I wonder if it's driver issues, or if there's anything that can be done to solve the problem.

SumnerH

07-02-2008 08:09:03

So looks like it was a driver issue.
Ok, I kind of suspected that.

Too bad the grass isn't showing up properly though. The grass seems to have a lot of problem with OpenGL & ATI. I wonder if it's driver issues, or if there's anything that can be done to solve the problem.


http://wiki.cchtml.com/index.php/Features says that the ATI driver "Provides some OpenGL 2.0 commands BUT NOT the OpenGL 2.0 version of the shading language. The ATI driver uses a version of the shading language called the ARB extension. The ARB extension was used before OpenGL 2.0 was finished." That's in reference to the Linux drivers but I wouldn't be surprised if similar limitations apply to the Windows OpenGL drivers.

I can only speculate on what that means, but it's possible that there's some subset of OpenGL 2.0 that would work on both ATI and other platforms without much pain. It's also possible that it's a lost cause (or not worth the pain in general), and only those deeply interested in supporting ATX/OpenGL should bother thinking about it.

I'll be investigating more, so I'll let you know if I can get satisfactory results on ATX/OpenGL.