gareth
13-08-2010 05:49:14
Hi guys. Could someone please give me some advice on how to get Hydrax to work with Python-Ogre under Linux? Do I have to generate the wrapper, compile and install Hydrax? I see that the source code is included in the "Third Party" folder.
Thanks,
Gareth
dermont
13-08-2010 11:27:30
Hi guys. Could someone please give me some advice on how to get Hydrax to work with Python-Ogre under Linux? Do I have to generate the wrapper, compile and install Hydrax? I see that the source code is included in the "Third Party" folder.
Thanks,
Gareth
Yes that should do it , If you are following the build steps from
http://wiki.python-ogre.org/index.php/LinuxBuildV4, then Building Additional Modules steps 3 to 5 for hydrax should work fine, e.g:
3. cd ~/development
python python-ogre/BuildModule.py -g hydrax
4. cd ~/development
python python-ogre/BuildModule.py -c hydrax
5. cd ~/development
python python-ogre/BuildModule.py -b install
The source code from the "Third Party" folder will be copied to the relevant folder (generated/hydrax_0.5.1) when you generate the wrapper code (step 3) and compiled along with the wrapper code (step 4) to create the python hydrax module.
gareth
14-08-2010 01:45:57
Thanks a lot, I will try that. Question: Can I modify the Hydrax source code in the "Third Party" folder and recompile it? I guess that seems like an obvious "yes" but Im not sure exactly how wrappers work. Does the Python-Ogre wrapper for Hydrax simply define an interface for Python?
Thanks for any help, I really want to understand this better.
Gareth
gareth
14-08-2010 02:24:02
Now when I try to run the hydrax demo I get this error:
OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at /home/gareth/dev/ogre/OgreMain/src/OgreGpuProgramParams.cpp (line 1391)
I tried the following from this thread
http://www.ogre3d.org/addonforums/viewtopic.php?f=20&t=9550 :
Setting shader mode to CG in HydraxDemo.hdx
Changing the material scripts for palm and island to use the cg materials
Anyone having this problem, or know how to fix it?
Thanks
dermont
15-08-2010 02:36:49
gareth
15-08-2010 18:42:04
Thanks, that worked after I downloaded those files.
gareth
17-08-2010 22:51:47
gareth
18-08-2010 00:28:55
Answered my own question. Had to change some code in Hydrax's MaterialManager.cpp:
"uniform sampler1D uFresnelMap : register(s" + Ogre::StringConverter::toString(TexNum) + ")";
change to
"uniform sampler2D uFresnelMap : register(s" + Ogre::StringConverter::toString(TexNum) + ")";
Next,
"float fresnel = tex1D(uFresnelMap,dotProduct);\n" +
change to
"float fresnel = tex2D(uFresnelMap,float2(dotProduct,dotProduct));\n" +
Next,
"uniform sampler1D uFresnelMap : register(s" + Ogre::StringConverter::toString(TexNum) + ")";
change to
"uniform sampler2D uFresnelMap : register(s" + Ogre::StringConverter::toString(TexNum) + ")";
and
"float fresnel = tex1D(uFresnelMap,dotProduct);\n" +
change to
"float fresnel = tex2D(uFresnelMap,float2(dotProduct,dotProduct));\n" +
Now the water reflects the sky as is should! Hopefully that will help someone.
rdrey
18-08-2010 17:54:29
Thanks for that fix. I had noticed that the same hydrax demo looked less awesome in linux than in windows a while ago, but didn't go into it any further.
When I have time some time in the future I'll finally use pyogre + hydrax + caelum.
gareth
27-08-2010 21:59:52