Problems with 0.5 on Linux

fog

17-03-2009 10:23:05

Hi,

after a little bit of tweaking the workspace to work on Linux I managed to build Hydrax 0.5 with Ogre3D 1.6.1. Running with ShaderMode set to 2 (GLSL) gives the following error:

[Hydrax] HydraxDemo.hdx loaded.
High-level program _Hydrax_GodRays_VP encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader _Hydrax_GodRays_VP in loadFromSource at OgreGLSLProgram.cpp (line 156)
High-level program _Hydrax_GodRays_FP encountered an error during loading and is thus not supported.
OGRE EXCEPTION(3:RenderingAPIException): Failed to preprocess shader _Hydrax_GodRays_FP in loadFromSource at OgreGLSLProgram.cpp (line 156)
An exception has occured: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)

while setting it to 0 or 1 gives:


[Hydrax] HydraxDemo.hdx loaded.
An exception has occured: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)

Any idea of how to fix that?

Thanks,
fog

Xavyiy

17-03-2009 10:33:10

GLSL is not yet implemented in Hydrax, you must use CG mode under OpenGL, anyway you need to change palm and island demo materials to CG(you've just to change the .material scripts, also you can download the 0.4 precompiled demo that includes the CG version of these materials).

Xavi

fog

17-03-2009 13:43:53

I modified the materials as suggested and now it runs until after loading Palm.mesh and then zonk! an X-related crash:

X Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 2 (X_ChangeWindowAttributes)
Serial number of failed request: 8
Current serial number in output stream: 10

Any idea about that? All other Ogre3D demos run fine.

Thanks,
fog

ronybeck

05-04-2009 20:00:57

I modified the materials as suggested and now it runs until after loading Palm.mesh and then zonk! an X-related crash
Thanks,
fog


Yep, because the demo is written with Windows in mind! The demo uses two frame listeners, one inherited version of the ExampleFrameListener and the other comes as a part of ExampleApplication. Both of these initialise OIS. This is bad! Very bad! X will only allow one lock on input devices, starting OIS twice will result in 2 attempts to lock input devices. The only solution that I can be bothered to get working was to comment out the following line from ExampleApplication.h.


line 140 //createFrameListener();

Make sure you uncomment it when you are done compiling so it doesn't break future programmes using this.

The real solution to write the demo so it only needs 1 frame listener and one instance of OIS. But since this demo compiles fine on windows, I doubt it will get the attention.

I also found that the code blocks project doesn't work as well. Not on windows or on linux. And it really isn't that hard to make it work right. I will attempt to attach the copy of the project I used to successfully build it on linux and windows. I have added in the material files from 0.4 to make it work on linux.

tsmithtree

28-04-2009 07:44:24

I tried to change the materials to the CG versions from 0.4 and added the cg programs to the correct directory and removed the HLSL ones, but I'm still getting this error. I also changed the hydrax config file to use shader mode 1 for CG.
Can someone help me out?

EDIT: Fixed it; OGRE wasn't detecting CG properly. Now I get a segmentation fault in mHydrax->create()
I have the 0.3 linux version working just fine. It would be much appreciated if someone would update it; if not, I'll try myself when I have some time.

EDIT2: Hydrax 0.5 now works for me in linux; I just added all the hydrax source files to my own project. Seems to compile fine. Haven't tried the demo, so I don't know if it works.

EDIT3: I got it to compile as its own plugin by making a c::b project from scratch. Also, make sure you apply the CG/opengl reflection fix described on these forums, or else the water won't render correctly.

ramy

27-05-2009 03:15:34

i changed the files in Demo1/Media/materials/scripts and Demo1/Media/materials/programs to the CG files in the 0.4 files and set the shader mode in the HydraxDemo.hdx file to 1

but I can't seem to get passed the OPs error, i still get:

22:21:47: [Hydrax] Hydrax created.
22:21:47: [Hydrax] HydraxDemo.hdx loaded.
22:21:47: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at OgreGpuProgram.cpp (line 1087)


any thoughts?

just like the poster above me, i fixed this by making my own Code Blocks project from scratch

r.d.

tsmithtree

29-05-2009 07:22:03

ramy:
You might be having the same problem I did, where ogre wasn't loading the correct cg program manager plugin.
My guess as to what may be the problem:
1. You haven't copied all the right materials, but it sounds like you got the right ones so no problems there.
2. OGRE isn't detecting cg properly (check your plugins.cfg and make sure it points to /usr/lib/OGRE or similar)
3. There's some problem with shaders on your graphics setup.
Try compiling the 0.3 native linux version, available on the hydrax wiki page. It worked out of the box for me. If this works and 0.5 doesn't, then it likely has to do with your config files. If it doesn't work, it might be a problem with cg shaders on your machine.

Sorry if I couldn't be of much help, but this is all I can think of.

ramy

29-05-2009 12:11:13

ramy:
You might be having the same problem I did, where ogre wasn't loading the correct cg program manager plugin.
My guess as to what may be the problem:
1. You haven't copied all the right materials, but it sounds like you got the right ones so no problems there.
2. OGRE isn't detecting cg properly (check your plugins.cfg and make sure it points to /usr/lib/OGRE or similar)
3. There's some problem with shaders on your graphics setup.
Try compiling the 0.3 native linux version, available on the hydrax wiki page. It worked out of the box for me. If this works and 0.5 doesn't, then it likely has to do with your config files. If it doesn't work, it might be a problem with cg shaders on your machine.

Sorry if I couldn't be of much help, but this is all I can think of.


hey!

actually rebuilding the demo inside a fresh codeblocks project worked, but um, i was pretty sure damn sure i did an edit and posted that! :p

oh well, thanks for you advice anyway, in fact, your steps are similar to what i did. i did try the 0.3 version afterwards before rebuilding the project :D

tsmithtree

29-05-2009 18:07:35

oops sorry I guess I misunderstood. In any case, hopefully it can help someone else having issues with compiling hydrax under linux. Seems like making a fresh project in codeblocks is the way to go.

didito

26-08-2009 15:14:11

so which changes are we speaking of?

i know of
1) change shadermode to 1
2) include the cg shader files (from the hydraxeditor) in the resource directories
3) include the cg shader references in the materials Island.material and Palm.material
4) fixes from [url="http://binbinwelkin.blogspot.com/2009/04/hydrax-opengl-version.html";]here, which i do not know to integrate

is there anything else?