Hydrax v0.4 - New version released + Editor!

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Locked
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

eugen wrote:realy cool! is the design of the class supporting multiple water surfaces in a single scene manager? (using the same camera i suppose)
At the moment ony one mesh(water surface), sorry.
Beatnik Joe wrote:Very nice job! These effects are really looking great right now. That endless ocean effect is... hypnotic!

I was also wondering -- is the Demo sample project supposed to look the same as the downloadable binary? Mine looks very different (much, much darker and a lot less clear.) I might just have something misconfigured, but I was wondering if these two apps are basically the same thing.
Yes, the downlaodable binary is the demo project compiled, wihtout any changes(Using Ogre December CVS Snapshot and VS 2005).
What ogre version are you using? Can you post some screenshots of your results? Do you change any code in the project demo?
Edit: Are you using OpenGL render system? at the moment there're some issues with OpenGL render system and reflections.(CG bug I think...)

Xavi
User avatar
eugen
OGRE Expert User
OGRE Expert User
Posts: 1422
Joined: Sat May 22, 2004 5:28 am
Location: Bucharest
x 8
Contact:

Post by eugen »

thank you for the prompt response
i have another question i bump in today: is the implementation working in a multiple camera scenario? here it seems i have alots of artefacts for the main camera which is the one i use for the water when instancing other cameras as well
will u accept patches?
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

eugen wrote:thank you for the prompt response
i have another question i bump in today: is the implementation working in a multiple camera scenario? here it seems i have alots of artefacts for the main camera which is the one i use for the water when instancing other cameras as well
will u accept patches?
At the moment hydrax only works with one main camera(Which is used for Rtts's viewports and projected grid module), but I think it won't be very hard to add a Hydrax::setCamera(...) funtion to change the Hydrax camera(and call Hydrax::setCamera(...) in the render target listener). I've added this feature to 0.6 version roadmap.

Patches are accepted but I think wating to 0.4 or 0.5 version is the best options to submit patches, because at the moment I'm reestructuring all the classes.
This is the actual high-level roadmap:

Code: Select all

0.3 roadmap:

 * Create a Noise class and code the Perlin Noise module.
 * Rewrite the following modules: (An modify Mesh class). 
   - Simple grid
   - Imanted grid
   - Projected grid
 * Finish Save/Load config file 
 + Hydrax editor 0.3

0.4 roadmap :

 * Underwater effects
 * Writte Radial grid module
 + Hydrax editor 0.4
 
0.5 roadmap :
 
 * Writte FFT Noise module
 + Hydrax editor 0.5

0.6 roadmap :
 
 * Multiple modules at same time(multiple water surfaces)
 * Allow multiple camera scenario
 + Hydrax editor 0.6
  
Xavi
n1000
Gnoblar
Posts: 17
Joined: Tue Feb 06, 2007 5:11 pm

Post by n1000 »

Any chance of changing the license from GPL to LGPL?
reptor
Ogre Magi
Posts: 1120
Joined: Wed Nov 15, 2006 7:41 pm
Location: Finland
x 5

Post by reptor »

n1000 wrote:Any chance of changing the license from GPL to LGPL?
I second that.

The GPL license means that I can't use Hydrax in my project. If it was LGPL, I would have no problem.

I would like to use Hydrax.

But I understand if the author doesn't want to change the license, it is his work.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

reptor wrote:
n1000 wrote:Any chance of changing the license from GPL to LGPL?
I second that.

The GPL license means that I can't use Hydrax in my project. If it was LGPL, I would have no problem.

I would like to use Hydrax.

But I understand if the author doesn't want to change the license, it is his work.
Not problem about that, I have been considering for some time ago to change the license to LGPL, so you can use Hydrax in your app; you can consider that Hydrax will be LGPL. At a first time I haven't payed much attention to license, but changing to LGPL license is the best option. ;)

Sorry for my English :roll:
n1000
Gnoblar
Posts: 17
Joined: Tue Feb 06, 2007 5:11 pm

Post by n1000 »

Thanks a lot! I've been wanting to use Hydrax in my project for some time, but I couldn't because it was GPL and not LGPL. So Hydrax is LGPL now or in a future release?
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

n1000 wrote:Thanks a lot! I've been wanting to use Hydrax in my project for some time, but I couldn't because it was GPL and not LGPL. So Hydrax is LGPL now or in a future release?
Now ;)
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Having a little trouble getting working with Hydrax. I'm not entirely sure as to where to begin to incorporate it?

I tried to do a straight rip from the demo .cpp of Hydrax, but end up with the following errors:

Code: Select all

1>------ Build started: Project: Ogre3D Flight Simulator, Configuration: Debug Win32 ------
1>Compiling...
1>Main.cpp
1>c:\ogresdk\samples\include\exampleapplication.h(172) : warning C4101: 'mPaused' : unreferenced local variable
1>c:\ogresdk\samples\include\exampleapplication.h(171) : warning C4101: 'mSpeedFactor' : unreferenced local variable
1>c:\ogresdk\samples\include\exampleapplication.h(173) : warning C4101: 'mPostFiltering' : unreferenced local variable
1>c:\users\cobra\desktop\ogre3d\hydrax-v0.2\hydrax\src\noise\noiseutils.h(635) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
1>c:\users\cobra\desktop\ogre3d\hydrax-v0.2\hydrax\src\noise\noiseutils.h(1028) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data
1>Linking...
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setPolygonMode(int const &)" (__imp_?setPolygonMode@Hydrax@1@QAEXABH@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setFullReflectionDistance(float const &)" (__imp_?setFullReflectionDistance@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setGlobalTransparency(float const &)" (__imp_?setGlobalTransparency@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setCausticsScale(float const &)" (__imp_?setCausticsScale@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setSmoothPower(float const &)" (__imp_?setSmoothPower@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setDepthColor(class Ogre::Vector3 const &)" (__imp_?setDepthColor@Hydrax@1@QAEXABVVector3@Ogre@@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setNormalDistortion(float const &)" (__imp_?setNormalDistortion@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setSunColor(class Ogre::Vector3 const &)" (__imp_?setSunColor@Hydrax@1@QAEXABVVector3@Ogre@@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setDepthLimit(float const &)" (__imp_?setDepthLimit@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setPlanesError(float const &)" (__imp_?setPlanesError@Hydrax@1@QAEXABM@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setPosition(class Ogre::Vector3 const &)" (__imp_?setPosition@Hydrax@1@QAEXABVVector3@Ogre@@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::create(void)" (__imp_?create@Hydrax@1@QAEXXZ) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setShaderMode(enum Hydrax::MaterialManager::ShaderMode const &)" (__imp_?setShaderMode@Hydrax@1@QAEXABW4ShaderMode@MaterialManager@1@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setModule(class Hydrax::Module::Module *)" (__imp_?setModule@Hydrax@1@QAEXPAVModule@21@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setComponents(enum Hydrax::HydraxComponent const &)" (__imp_?setComponents@Hydrax@1@QAEXABW4HydraxComponent@1@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setRttOptions(struct Hydrax::RttOptions const &)" (__imp_?setRttOptions@Hydrax@1@QAEXABURttOptions@1@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Hydrax::RttOptions::RttOptions(enum Hydrax::TextureQuality const &,enum Hydrax::TextureQuality const &,enum Hydrax::TextureQuality const &)" (__imp_??0RttOptions@Hydrax@@QAE@ABW4TextureQuality@1@00@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Hydrax::Module::PerlinPG::PerlinPG(class Hydrax::Hydrax *,class Ogre::Plane const &,struct Hydrax::Module::PerlinPG::Options const &)" (__imp_??0PerlinPG@Module@Hydrax@@QAE@PAV22@ABVPlane@Ogre@@ABUOptions@012@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall Hydrax::Hydrax::setMeshOptions(class Hydrax::Mesh::Options *)" (__imp_?setMeshOptions@Hydrax@1@QAEXPAVOptions@Mesh@1@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Hydrax::Hydrax::Hydrax(class Ogre::SceneManager *,class Ogre::Camera *)" (__imp_??0Hydrax@0@QAE@PAVSceneManager@Ogre@@PAVCamera@2@@Z) referenced in function "protected: virtual void __thiscall TutorialApplication::createScene(void)" (?createScene@TutorialApplication@@MAEXXZ)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Hydrax::Module::PerlinPG::create(void)" (?create@PerlinPG@Module@Hydrax@@UAEXXZ)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Hydrax::Module::PerlinPG::update(float const &)" (?update@PerlinPG@Module@Hydrax@@UAEXABM@Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Hydrax::Module::Module::saveCfg(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > &)" (?saveCfg@Module@1Hydrax@@UAEXAAV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Hydrax::Module::Module::loadCfg(class Ogre::ConfigFile &)" (?loadCfg@Module@1Hydrax@@UAE_NAAVConfigFile@Ogre@@@Z)
1>Main.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall Hydrax::Module::PerlinPG::getHeigth(class Ogre::Vector2 const &)" (?getHeigth@PerlinPG@Module@Hydrax@@UAEMABVVector2@Ogre@@@Z)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Hydrax::Size::~Size(void)" (__imp_??1Size@Hydrax@@QAE@XZ) referenced in function "public: __thiscall Hydrax::Mesh::ProjectedGridOptions::ProjectedGridOptions(int const &)" (??0ProjectedGridOptions@Mesh@Hydrax@@QAE@ABH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall Hydrax::Size::Size(int const &,int const &)" (__imp_??0Size@Hydrax@@QAE@ABH0@Z) referenced in function "public: __thiscall Hydrax::Mesh::ProjectedGridOptions::ProjectedGridOptions(int const &)" (??0ProjectedGridOptions@Mesh@Hydrax@@QAE@ABH@Z)
1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __thiscall Hydrax::Module::PerlinPG::~PerlinPG(void)" (__imp_??1PerlinPG@Module@Hydrax@@UAE@XZ) referenced in function "public: virtual void * __thiscall Hydrax::Module::PerlinPG::`scalar deleting destructor'(unsigned int)" (??_GPerlinPG@Module@Hydrax@@UAEPAXI@Z)
1>..\bin\Debug\Engine.exe : fatal error LNK1120: 28 unresolved externals
1>Build log was saved at "file://c:\Users\Cobra\Desktop\Ogre3D Flight Simulator\Ogre3D Flight Simulator\Ogre3D Flight Simulator\Debug\BuildLog.htm"
1>Ogre3D Flight Simulator - 29 error(s), 5 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

this is my Code;

Code: Select all

#include "ExampleApplication.h"
#include "Caelum.h"
#include "Hydrax.h"
#include "Modules/Perlin/Perlin.h"
#include "Modules/PerlinPG/PerlinPG.h"
#define _def_SkyBoxNum 5
#define _def_PGComplexity 256


class TutorialApplication : public ExampleApplication
{
protected:
public:
    TutorialApplication()
    {
    }

    ~TutorialApplication() 
    {
    }
protected:
    void createScene(void)
    {

		SceneNode *myNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
		Entity *islandEntity = mSceneMgr->createEntity("island","island.mesh");
		myNode->attachObject(islandEntity);

		Hydrax::Hydrax* mHydrax = new Hydrax::Hydrax(mSceneMgr, mCamera);

		mHydrax->setMeshOptions(
			static_cast<Hydrax::Mesh::Options*>(new Hydrax::Mesh::ProjectedGridOptions(_def_PGComplexity)));

		Hydrax::Module::PerlinPG *mModule
			= new Hydrax::Module::PerlinPG(mHydrax,
			                               Ogre::Plane(Ogre::Vector3(0,1,0),
										   Ogre::Vector3(0,0,0)),
										   Hydrax::Module::PerlinPG::Options(_def_PGComplexity));
        mHydrax->setRttOptions(
                   Hydrax::RttOptions(
                                      Hydrax::TEX_QUA_1024,
                                      Hydrax::TEX_QUA_1024,
                                      Hydrax::TEX_QUA_1024));

		mHydrax->setComponents(
            static_cast<Hydrax::HydraxComponent>(Hydrax::HYDRAX_COMPONENT_SUN    |
                                                 Hydrax::HYDRAX_COMPONENT_FOAM   |
                                                 Hydrax::HYDRAX_COMPONENT_DEPTH  |
                                                 Hydrax::HYDRAX_COMPONENT_SMOOTH |
                                                 Hydrax::HYDRAX_COMPONENT_CAUSTICS));

	
		mHydrax->setModule(static_cast<Hydrax::Module::Module*>(mModule));

		
		mHydrax->setShaderMode(Hydrax::MaterialManager::SM_HLSL);

        mHydrax->create();

        mHydrax->setPosition(Ogre::Vector3(0,0,0));
        mHydrax->setPlanesError(37.5);
        mHydrax->setDepthLimit(110);
        mHydrax->setSunColor(Vector3(1,1,1));
        mHydrax->setNormalDistortion(0.025);
        mHydrax->setDepthColor(Ogre::Vector3(0.04,0.135,0.185));
        mHydrax->setSmoothPower(5);
		mHydrax->setCausticsScale(12);
        mHydrax->setGlobalTransparency(0.1);
        mHydrax->setFullReflectionDistance(99999997952.0);
		mHydrax->setGlobalTransparency(0);
        mHydrax->setPolygonMode(0);

		
		
		
    }
};

#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
#define WIN32_LEAN_AND_MEAN
#include "windows.h"

INT WINAPI WinMain( HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT )
#else
int main(int argc, char **argv)
#endif

{
    // Create application object
    TutorialApplication app;

    try {
        app.go();
	} catch( Ogre::Exception& e ) {
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 
        MessageBoxA( NULL, e.what(), "An exception has occurred!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
#else
        fprintf(stderr, "An exception has occurred: %s\n",
                e.what());
#endif
    }

    return 0;
}
Forgive me if this is a really stupid error. I'm still new to C++ and Ogre.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

Cobra8472 wrote:Having a little trouble getting working with Hydrax. I'm not entirely sure as to where to begin to incorporate it?

I tried to do a straight rip from the demo .cpp of Hydrax, but end up with the following errors:
...
Forgive me if this is a really stupid error. I'm still new to C++ and Ogre.
You need to add to your linker the Hydrax.lib generated compiling Hydrax project. After it go to your project linker options and add Hydrax.lib, not forgot add the Hydrax.dll to your bin directory. Good luck!
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Never Mind, I had incorrectly added the Hydrax libs to my project.



Great work :D


Edit: Didn't refresh before I replied. Yep, that was it Xaviy. Thanks for the quick response! :)
Last edited by Cobra8472 on Wed Mar 26, 2008 10:24 pm, edited 1 time in total.
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

Cobra8472 wrote:Never Mind, I had incorrectly added the Hydrax libs to my project.

Great work :D
:wink:
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Hehe, as expected, my application crashes with finesse.

Is there a little guide or tutorial available on how to get Hydrax up and running? What needs to be updated every frame, how to create the water, and so forth. Even the demo you have included is too complicated for me :/

Sorry for the noobish questions - only bother if you have some spare time .
User avatar
RichTufty
Gnoblar
Posts: 22
Joined: Fri Feb 16, 2007 6:03 pm

Post by RichTufty »

Great stuff, looks really really good. Can this be plugged in to Mogre/C# ?
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

Cobra8472 wrote:Hehe, as expected, my application crashes with finesse.

Is there a little guide or tutorial available on how to get Hydrax up and running? What needs to be updated every frame, how to create the water, and so forth. Even the demo you have included is too complicated for me :/

Sorry for the noobish questions - only bother if you have some spare time .
Actually there aren't any guide or tutorial, just the Hydrax demo project, In a near future I hope to write some documentation in the wiki, but actually I've a lot of exams for three months.

About the crash, what the ogre log says?, each frame you need to call Hydrax::update(...). Have you tried starting the binary trought the debugger?
RichTufty wrote:Great stuff, looks really really good. Can this be plugged in to Mogre/C# ?
Actually there isn't a C# wrapper, but if someone works on this, I advise waiting at least to 0.4 version.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Don't put too much effort on documentation, development of hydrax would be more important at this stage, IMO. :)
Creator of QuickGUI!
User avatar
Thrakbad
Halfling
Posts: 73
Joined: Fri Mar 23, 2007 4:32 pm
Location: Essen, Germany
Contact:

Post by Thrakbad »

I agree. You can figure out how to get it running on your own by spending a little time looking at the Demo source code.
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Well, you can, but not if you fail horribly like I :P

Sorry for wasting your time Xavyiy - hopefully you were new to this once upon a time aswell :)

The ogre.log gives no clues as to what the error might be, here's the last lines;

Code: Select all

19:41:54: Parsing script Example-CubeMapping.overlay
19:41:54: Parsing script Example-DynTex.overlay
19:41:54: Parsing script Example-Water.overlay
19:41:55: Parsing script Shadows.overlay
19:41:55: Finished parsing scripts for resource group General
19:41:55: Parsing scripts for resource group Internal
19:41:55: Finished parsing scripts for resource group Internal

I'm not entirely sure if you must setup all the options pertaining Hydrax like you did in the Demo, or if there are default values? Could this be the issue?

Here's my code:

Code: Select all

#include "ExampleApplication.h"
#include "Caelum.h"
#include "Hydrax.h"
#include "Modules/Perlin/Perlin.h"
#include "Modules/PerlinPG/PerlinPG.h"
Hydrax::Hydrax *mWater = 0;


class WaterFrameListener : public ExampleFrameListener
{
public:
    WaterFrameListener(RenderWindow* win, Camera* cam, SceneManager *sceneMgr)
        : ExampleFrameListener(win, cam, false, false)
    {
    }

    bool frameStarted(const FrameEvent &evt)
    {
		mWater->update(evt.timeSinceLastFrame);
        return ExampleFrameListener::frameStarted(evt);
    }
protected:
     SceneManager *mSceneMgr;
    
};

class TutorialApplication : public ExampleApplication
{
protected:
public:
    TutorialApplication()
    {
    }

    ~TutorialApplication() 
    {
    }
protected:
    void createScene(void)
    {
		mWater = new Hydrax::Hydrax(mSceneMgr, mCamera);
		mWater->create();
		
    }
};
Is there more that needs to be done with Hydrax?

The call stack ends up at this line in hydrax.cpp:
HydraxLOG("Hydrax object created.");


Once again, sorry for the newbie mistakes!
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

I admit I haven't used Hydrax yet, but I have a question based on the code snippet above: Does Hydrax support changing of cameras? Something like Hydrax::updateCamera(Camera* c); that will switch everything to the new camera behind the scenes? :)
Creator of QuickGUI!
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

Cobra8472 wrote:Well, you can, but not if you fail horribly like I :P

Sorry for wasting your time Xavyiy - hopefully you were new to this once upon a time aswell :)

The ogre.log gives no clues as to what the error might be, here's the last lines;

Code: Select all

...
I'm not entirely sure if you must setup all the options pertaining Hydrax like you did in the Demo, or if there are default values? Could this be the issue?

Here's my code:

Code: Select all

...
Is there more that needs to be done with Hydrax?

The call stack ends up at this line in hydrax.cpp:
HydraxLOG("Hydrax object created.");

Once again, sorry for the newbie mistakes!
You need add the noise module and set the mesh options(If you want to use the infinite ocean module, copy the initialization code from the demo project).
My advide is copying the demo project code in your app, and when it runs fine, modifying the parameters as you like! and not forgot add the Hydrax media files and modify resources.cfg file :) For any problem or question ask here, reply you only spend me a few minutes!

Code: Select all

I admit I haven't used Hydrax yet, but I have a question based on the code snippet above: Does Hydrax support changing of cameras? Something like Hydrax::updateCamera(Camera* c); that will switch everything to the new camera behind the scenes? 
Actually not, but it will be very easy to do, only update the hydrax camera pointer, update rtt's viewport and the projected grid camera. Other question is supporting multiple rendering cameras at same time(same frame), I haven't looking into this yet.(For projected need module it will be necesary recalculate the mesh geomtry for each camera in each frame, recalculate Rtt's for each camera, etc..).

Xavi
User avatar
ahmedismaiel
OGRE Contributor
OGRE Contributor
Posts: 217
Joined: Wed Jan 25, 2006 11:16 pm
Location: Redmond,WA

Post by ahmedismaiel »

your work is awesome man ,

although ,the water foam is still bothering me because it's showing up every where ,i notices that the caustics are only showing up at the shores ,please instruct me to what i need to change to make the foam only show up at the shore?

Thanks
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

ahmedismaiel wrote:your work is awesome man ,

although ,the water foam is still bothering me because it's showing up every where ,i notices that the caustics are only showing up at the shores ,please instruct me to what i need to change to make the foam only show up at the shore?

Thanks
Just substitute in MaterialManager.cpp this line:

Code: Select all

"oColor=lerp(oColor,float4(1,1,1,1),foamTransparency*foam);\n";
by:

Code: Select all

"oColor=lerp(oColor,float4(1,1,1,1),foamTransparency*foam*depth.x);\n";
You need HYDRAX_COMPONENT_DEPTH and HYDRAX_COMPONENT_CAUSTICS components for this little hack, otherwise it will be a shader compile error.

You should set a high foam transparency, in range [3-5]:

Code: Select all

Hydrax::setFoamTransparency(3.5)
I hope this work for you!

Xavi
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Me again!

I followed your suggestion and tried to compile the demo. It compiles with any errors, but when I try and start the application the following happens;

Image



Any ideas? :?:
User avatar
Xavyiy
OGRE Expert User
OGRE Expert User
Posts: 847
Joined: Tue Apr 12, 2005 2:35 pm
Location: Albacete - Spain
x 87

Post by Xavyiy »

Cobra8472 wrote:Me again!

I followed your suggestion and tried to compile the demo. It compiles with any errors, but when I try and start the application the following happens;
Any ideas? :?:
This happens when you use dll's that you have compiled with a different Ogre version.The most problably thing is that you're mixing some dll's that you have compiled with different Ogre versions. Are you using the Hydrax.dll from the binary downloadable demo? you need to use the Hydrax.dll compiled with your Ogre version! Check this!
Cobra8472
Halfling
Posts: 83
Joined: Thu Jun 02, 2005 4:44 pm

Post by Cobra8472 »

Yep, that was the issue. I thought I had used the one I compiled but alas, that was not the case.It opens the configuration window now, and starts up - but then an exception appears;

Image


Ogre.log;

Code: Select all

13:23:36: [Hydrax] Hydrax object created.
13:23:36: [Hydrax] Module set.
13:23:36: [Hydrax] Creating module.
13:23:36: [Hydrax] Creating PerlinPGModule module.
13:23:36: [Hydrax] PerlinPGModule created.
13:23:36: [Hydrax] Module created.
13:23:36: [Hydrax] Creating materials,
13:23:36: [Hydrax] Creating water material...
13:23:36: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at ..\src\OgreGpuProgram.cpp (line 873)
I feel like such a tool for being the only one with problems >.<
Locked