Particle Systems and Hydrax refraction


16-10-2008 18:23:31

First sorry for my thousand thread.

I have a problem with my particle rain (I use particle universe), before biding hydrax all is ok, but now, I have a problem with rain over water.

I think that it isn't needed to disable refraction to resolve this problem, i think that I need only to enable this hydrax effect only for an observer that see from up-to-down (out of water, into the water).

what do you think? and how can I do this?


16-10-2008 18:26:23

Can you post a little rar with your ejecutable/media files, just to think the best solution(It doesn't seem difficult) depending of results.


16-10-2008 18:29:33

you can find the packets here:

but in those version there isn't hydrax binded, you need the version in the screenshot or you need only to see the particle system files?


16-10-2008 18:32:57

you can find the packets here:

but in those version there isn't hydrax binded, you need the version in the screenshot or you need only to see the particle system files?

The screenshot version, to see the issue in real-time.


16-10-2008 18:41:48

In this I use the simple grid rtt, but I want use the projected to easily merge sun and water at horizon... but projected give me that bug of other thread.

However here the demo:

to start it you need:
latest openal
latest directx 9 or higher
latest physx system software

ps: don't look at sun in the water, hydrax is updated every 0.5 seconds while sun is more fast, but only because time is accelerated :)


16-10-2008 19:08:08

Okey, there're two possible things that cause these artifacts:
1) Particle universe geometry are rendered in spite of that the camera is cliped by a user clip plane (Camera->enableCustomNearClipPlane()). -> Particle universe bug
2) You've to set a lesser value of Hydrax::setPlanesError(...), wich represents the height of the clip plane (ClipPlane.y = HydraxPos.y + PlanesErrorValue).



16-10-2008 19:21:38

I tried to set it to 0.0001 but the problem still remain, you can try by yourself changing this value in the .hdx file (media/Hydrax).

I changed it into file and into code, same result.

So what I have to ask in the particle universe forum? I don't understand well which is the problem and how resolve it.

Thanks for patience


16-10-2008 19:25:07

The problem is that particles are rendered in Refraction RTT, which shouldn't.
For refraction RTT Hydrax uses a custom near clip plane that must occlude all the geometry that are "over it".
So, I think you must post it in P.Universe forums.


16-10-2008 19:29:46

but if I use vertex in hydrax... then I shouldn't have problems with particle system or I haven't understand nothing :?:


16-10-2008 19:33:01

Mmm it isn't related with this.
The refraction texture is rendered always in Hydrax

The problem is that near clip planes(Ogre/3D libraries feature) seems not to work with P.Universe. (If you see the screenshot the island is cutted!, and all objects over the clip planes aren't rendered, so the problem is that P.Universe particles are rendered over the clip plane).



16-10-2008 19:46:19

ok thanks, I'll see what can I do.

I'll make you know in this thread :)


16-10-2008 21:16:54

sorry for crossposting but I really don't know where beat my head.

PU doesn't do anything special with the clipplane (Ogre should take care for that). Does Ogre's particle plugin do the same? I expect so. Last time I looked in the Hydrax code, it seemed that it sets entities to invisible in the rendertarge update step (for a rtt), so billboards are still rendered.


16-10-2008 21:27:47

Hydrax doesn't set to invisible entities on Rtt's, only changes all Entities material in Depth RTT(Not reflection/refraction) and provides a method to get working the depth with all rendereables(not only entities) with Hydrax (MaterialManager::addDepthTechnique(...), see Hydrax demo for an example about how to get Hydrax working with the default terrain manager, the same for billboards, etc).

If PU doesn't do anything special with the clipplane, the error must be in Ogre.

You can try to debug Hydrax textures (Texture names are in page 24/25 of the hydrax thread in Using ogre in practice forum), if the clipplane doesn't clip PU billboards mean that Ogre has a bug or something like that.



17-10-2008 21:58:30

there's the debugged texture, I use projected grid with NM_VERTEX:


18-10-2008 10:26:38

So, I go forward with debug making some trying, here what happened:

I made a blank ogre application (that extend example application):

I put inside it, hydrax, particle universe, and particle fx.

both works good with hydrax as you can see:

then I tried to put particle fx into my demo, and it works good:

So, in summary:

blank application -> hydrax + particle fx - OK
blank application -> hydrax + particleuniverse - OK

My application -> hydrax + particle fx - OK
My application -> hydrax + particleuniverse - KO

Then with this information, can you help me find the which is the problem? I hope your anwer is yes...


Other updates, I noticed that the only thing different, between two application, is the config file that hydrax loaded...

in blank application I loaded this:
in my application I loaded this:

So, the parameter that cause the problem seems to be this:
<vector3>Position=-5000x100x-5000 ->works
<vector3>Position=-5000x0x-5000 -> don't works

can you xavi tell me what's the reason? I'm going crazy for this..

however, surely I'm noob because I did this mistake -.-'


18-10-2008 13:24:53

If the Position parameters causes this issue, It must be an Hydrax bug(I have changed a lot of things since 0.3, and in spite of trying to try all, it seems to be some bugs(little bugs, but bugs!).
I'm going to check it after studying some hours, wait to this night for some news.



18-10-2008 13:38:35

ok... I'm happy to found a bug, and more happy if you can solve it :)


18-10-2008 13:46:29

Just reading some your problem related code, and, not sure but possible(not tested yet), these kind of lines:
mHydrax->getCamera()->getPosition().y RttManager.cpp

maybe are the origin of this problem.

It must be getDerivedPosition, etc, because if you're moving the camera trought scene nods, camera->getPosition().y is always 0(or just a constant value).


(I'm going to try to fix it this night(GTM+1) and upload the fixed hydrax package)
Thanks for cathing bugs :)


18-10-2008 14:03:40

I'll wait you and more info about what this bug entails


18-10-2008 14:09:12

Mmm, I've to left right now to study,
just try to remplace RttManager.cpp with this new one:

recompile Hydrax and update Dll/Lib, recompile your app and check is the bug is still.



19-10-2008 01:03:07

I tried your fix, it works good, I'm so happy...

Now can you help me to resolve other problems? I'm your nightmare :P