OGRE Wiki
Support and community documentation for Ogre3D
Ogre Forums
ogre3d.org
Log in
Username:
Password:
CapsLock is on.
Remember me (for 1 year)
Log in
Home
Tutorials
Tutorials Home
Basic Tutorials
Intermediate Tutorials
Mad Marx Tutorials
In Depth Tutorials
Older Tutorials
External Tutorials
Cookbook
Cookbook Home
CodeBank
Snippets
Experiences
Ogre Articles
Libraries
Libraries Home
Alternative Languages
Assembling A Toolset
Development Tools
OGRE Libraries
List of Libraries
Tools
Tools Home
DCC Tools
DCC Tutorials
DCC Articles
DCC Resources
Assembling a production pipeline
Development
Development Home
Roadmap
Building Ogre
Installing the Ogre SDK
Setting Up An Application
Ogre Wiki Tutorial Framework
Frequently Asked Questions
Google Summer Of Code
Help Requested
Ogre Core Articles
Community
Community Home
Projects Using Ogre
Recommended Reading
Contractors
Wiki
Immediate Wiki Tasklist
Wiki Ideas
Wiki Guidelines
Article Writing Guidelines
Wiki Styles
Wiki Page Tracker
Ogre Wiki Help
Ogre Wiki Help Overview
Help - Basic Syntax
Help - Images
Help - Pages and Structures
Help - Wiki Plugins
Toolbox
Freetags
Categories
List Pages
Structures
Trackers
Statistics
Rankings
List Galleries
Ogre Lexicon
Comments
History: Hydrax
View page
Source of version: 30
(current)
{img src="img/wiki_up/Hydrax.jpg" alt="Hydrax.jpg" imalign="right"} __Author__: Xavier 'Xavyiy' Verguín González __Project__: OGRE Add-on Library (water) __Version__: 0.5.1 __Supported Platforms__: Windows, Linux, Mac __Supported Ogre Releases__: 1.4, 1.6, 1,7, 1.8, 1.9 __Official Download Page:__ [http://www.paradise-sandbox.com/#hydraxskyx.php|Hydrax & SkyX at Paradise Studios] __Documentation__: [http://modclub.rigsofrods.com/xavi/05APIDoc/html/|API Documentation(0.5 for the moment, 0.5.1 included in the sources .rar package)], Demo application source code and forum support __License__: [http://www.gnu.org/licenses/lgpl.html|GNU Lesser General Public License (LGPL)] (free for any use) __Status and bug reports__: [http://www.ogre3d.org/addonforums/viewforum.php?f=20|Hydrax forum] --- {maketoc} !!Introduction Hydrax is an add-on for Ogre which aim is to provide an easy-use library in order to __render pretty water scenes__. It's fully configurable, all effect, such as water depth effects, smooth transitions, foam effects, caustics, underwater god rays, ... can be modified in real-time as well as all options that do not depend of shaders such as Rtt's texture quality, hydrax geometry and noise modules options, you can change between different modules(geometry and noise) on-fly, etc... Hydrax has a modulable interface wich allows any kind of water geometry, actually there're three modules availables: The infinite ocean module, based on the projected grid concept, the simple grid module and the radial grid module; of course, hydrax geometry modules and noise modules can be coded by users. !!Videos {YOUTUBE(movie="http://www.youtube.com/watch?v=FL02s_MGIQc",width="640",height="420",allowFullScreen="y")}{YOUTUBE} !!Screenshots {img src="img/wiki_up/Hydrax_screenshot.png" alt="Hydrax_screenshot.png"} {img fileId="1931" alt="Hydrax screenshot 2" rel="box[g]"} {img src="img/wiki_up/Hydrax_04_5_.png" alt="Hydrax_04_5_.png"} {img src="img/wiki_up/Hydrax_04_2.png" alt="Hydrax_04_2.png"} {img src="img/wiki_up/Hydrax_04_1_.png" alt="Hydrax_04_1_.png"} Underwater rendering: (With underwater reflections and sun god rays!) {img src="img/wiki_up/Hydrax_04_3_.png" alt="Hydrax_04_3_.png"} {img src="img/wiki_up/Hydrax_04_4_.png" alt="Hydrax_04_4_.png"} __Videos__ * [http://www.youtube.com/watch?v=FL02s_MGIQc|Hydrax-SkyX demo video] * [http://modclub.rigsofrods.com/xavi/FFTNoisePics/FFTNewSamples.wmv|FFT noise video] * [http://vimeo.com/1435457|0.4 HD preview] * [http://modclub.rigsofrods.com/xavi/HydraxEditor%202008-10-09%2019-23-26-12.mp4|0.4 preview2 (mp4, 30Mb) ] * [http://www.youtube.com/watch?v=Tll6Bi2XblU|Hydrax v0.2 preview] * [http://www.youtube.com/watch?v=SvddAMjURKg|Hydrax v0.2 preview 2] !!Main features * Realistic fresnel refraction and reflection effects * Intelligent depth effects based on depth maps * Smooth transitions effects: Smooth transitions with all objects in the scene using the depth map * Caustics effects * Sunlight effects (Colour, Position, Sun strength, area, etc...) * Full underwater effects like underwater reflections, god rays... * Foam effects * Water editor * Vertex and GPU Normals generation * Decals support (to place any kind of texture on the water, like ship trails, water vegetables, etc) * Modulable interface (Geometry and noise modules) * HLSL and CG support (and GLSL in future versions) __Geometry modules:__ * Projected grid * Simple grid * Radial grid __Noise modules:__ * Perlin * FFT {DIV(class="Layout_box13")}For __more information__ go to __[http://www.ogre3d.org/addonforums/viewforum.php?f=20|the Hydrax forum]__.{DIV} !!Downloads Official download link can be found at the top of this page. Below are some alternative mirrors and links to forks: In lack of updates from the original author, here is a Github repository with latest community version and fixes: (Current version 0.5.4-5 (last updated 2012-11-01)) https://github.com/imperative/CommunityHydrax * [http://modclub.rigsofrods.com/xavi/Hydrax-v0.5.1_Demo1.rar|Precompiled demo] (version 0.5.1)%%%While running the demo __press 'M'__ to switch water presets! * [http://modclub.rigsofrods.com/xavi/Hydrax-v0.5.1.rar|Hydrax/Demo sources and media files] (version 0.5.1)%%%(Code::Blocks and VC++ 2005 project files included) * [http://modclub.rigsofrods.com/xavi/Hydrax-Editor-v0.5.1.rar|Hydrax editor] (with sources, version 0.5.1)%%%Hydrax config files are saved in ''bin/release/saved'' * [http://modclub.rigsofrods.com/xavi/hydrax-v0.3-linux.tar.bz2|Linux package] (old version 0.3)%%%Note: view Readme_Linux.txt * [http://modclub.rigsofrods.com/xavi/|Mirror] of all published Hydrax files __Linux__ install packs (by user [http://www.ogre3d.org/addonforums/memberlist.php?mode=viewprofile&u=13900|SanguinarioJoe]): (None of these links seem to work anymore, but the same packages seem to be in the "Mirror of all published Hydrax files" link right above this. * [https://launchpad.net/~sonsilentsea-team/+archive/sonsilentsea/+files/libhydrax_0.5.4-Ubuntu2.tar.gz|libhydrax_0.5.4-Ubuntu2.tar.gz] * [https://launchpad.net/~sonsilentsea-team/+archive/sonsilentsea/+files/hydrax-demo_0.5.4-Ubuntu1.tar.gz|hydrax-demo_0.5.4-Ubuntu1.tar.gz] * [https://launchpad.net/~sonsilentsea-team/+archive/sonsilentsea/+packages|file overview] of user SanguinarioJoe - maybe there is a newer version available !!Support the author If you have loved Hydrax, consider making a donation: (Xavyiy) {IMG(src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif",link="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=KSJ64XXQFH3P8")}{IMG} !!Current development status 2012-11 There hasn't been any activity from Hydrax author for a while, and many others has been finding bugs on the forum and even developing some new features. However since there was no central public place for Hydrax code, people have been just making their changes public on the forums in different places. So now I've tried to gather together all those fixes and start a community-maintained repository of the “latest” version of Hydrax. ([https://github.com/imperative/CommunityHydrax|github repository]) If you find any bugs or develop new features which you feel should be a part of generic Hydrax (and not some specific modification for your application), please add them to this repository. Either send a pull request or ask me (“heavydist” on the forums) to add you to the repository. You can even help the project by for example incorporating the demo into the repository, or writing documentation, etc... Also, here are some notes and some ad-hoc documentation which I've compiled based on my experiments with Hydrax. Current status (what works). If you start up the Hydrax/SkyX demo, you may notice that it only allows you to choose the Direct3D rendering system, and as it turns out, that's not a coincidence. Many things did not work correctly for my project in OpenGL, and it seems that Hydrax did not fully support it. However the things that didn't/don't work are due to lack of testing, not due to not being implemented, so you should be able to easily fix them. The situation with shaders requires special attention: original hydrax provides a choice of which shader language to use: Cg, HLSL or GLSL. All the shaders used by Hydrax are dynamically generated in MaterialManager.cpp and not stored in any resources. For example the dynamic generation can remove some textures from the shader if you shutdown certain functions of Hydrax. But the choice of shader language has created a lot of problems: in most cases, both the original author and some of the people working on the project have only been testing one shader language (the one they've been using in their project), and different things have worked differently in different languages. You can find many threads on the forum about things working in HLSL, but not in GLSL, or looking one way in cg, but not in HLSL, etc. This is both because there are different parts of code generating different shader language code, but also because there seem to be some subtle caveats, like HLSL and cg not being *exactly* the same, even though they appear to, or cg shaders handling differently in Direct3D or OpenGL, etc. The described problem, as well as the fact that everything that is needed for Hydrax can be done in cg, which compiles both for OpenGL and DirectX, I don't see the point in maintaining the support for different shader languages or even it's purpose from the beginning. I've been only developing the cg version of shaders, and I advise you to do the same. At this point (0.5.4 unofficial) cg seem to be the version where most features work. Things that people often ask about and that don't seem to be implemented right now are multiple hydraxes in the same scene and water which does not have the default planar shape perpendicular to y-axis. Both of them could be implemented of course, but you would have to really get familiar with how Hydrax is built and make a lot of modifications to it. Please submit a patch to the repo if you do though. Otherwise just check out the Demo to see how to use it and play with parameters, it's all pretty obvious. Currently known “bugs”: The certain bugs I know about I've put into the Community Hydrax code, but these are more cases of strange behaviour which I am not sure are due to a bug in Hydrax, they probably just due to me not using it correctly. But if you would stumble upon these, at least you will know how to fix them: Normal calculation in NM_VERTEX In MaterialManager.cpp there is a clause that calculates a term called dotProduct (in the shader) differently for NM_VERTEX than it does for the other two types of rendering. In my application that caused the term to always be 0, and the water was not rendered correctly. If you want to know if your water suffers from this, try to set globalTransparency Hydrax config value to 0 and check if the water looks fine. If there are like no reflections at all, you have this problem. (also this is the problem to fix if your image suffers from distant horizon looking too sharp) Fix: changed {CODE(wrap="1", colors="c++")} else { FragmentProgramData += "float dotProduct=dot(-camToSurface,pixelNormal);\n"; } {CODE} to {CODE(wrap="1", colors="c++")} else { FragmentProgramData += "float dotProduct=dot(camToSurface,pixelNormal);\n"; // was -camToSurface } {CODE} This bug seemed to be the same in both OpenGL and DirectX. Reflection flipped: For some reason DirectX and OpenGL handles a certain parameter differently in the cg shader, which for my application caused the reflection to be flipped in one of them or the other. And it only happened in some weird conditions, like other compositors being added to the scene, obscure... Anyway, if you do have this problem, you WILL know, the reflection looks completely fucked up, like this: http://www.youtube.com/watch?v=DC1SV41lypI But the fix is simple: Find the line {CODE(wrap="1", colors="c++")} "float3 reflection=tex2D(uReflectionMap,ProjectionCoord.xy+pixelNormalModified);\n" + {CODE} and insert this right before it: {CODE(wrap="1", colors="c++")} "ProjectionCoord.y = 1.0 - ProjectionCoord.y;\n" + {CODE} !!Roadmap Version 0.6: Library: * Improve underwater rendering. Update underwater depth calculations based on the distance, like the Crysis (Crytek) approach. * Improve Perlin and FFT normal map generator shaders * GLSL shaders * Multi-camera rendering support * Ogre 1.7.X native support Editor: * Port RBGui to Ogre 1.7.X * Port the editor to Ogre 1.7.X Demo: Examples: * Advanced example: using custom textures for depth calculations (0.5 version feature) * Advanced example: creating ship trails (decals). Tutorials: * Creating custom geometry and noise modules !!See also * [http://www.ogre3d.org/addonforums/viewforum.php?f=20|Hydrax forum] - News, details, questions, bug reports * [http://modclub.rigsofrods.com/xavi/05APIDoc/html/|Hydrax API documentation] * ((Managed Hydrax Wrapper)) - For use with ((MOGRE|Mogre)) * ((EGO Game Editor)) - Has support for Hydrax
Search by Tags
Search Wiki by Freetags
Latest Changes
Introduction - JaJDoo Shader Guide - Basics
RT Shader System
RapidXML Dotscene Loader
One Function Ogre
IDE Eclipse
FMOD SoundManager
HDRlib
Building Ogre V2 with CMake
Ogre 2.1 FAQ
Minimal Ogre Collision
...more
Search
Find
Advanced
Search Help
Online Users
118 online users