Announcement

Collapse
No announcement yet.

Pretty Water/ Reflection issue in DX9

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pretty Water/ Reflection issue in DX9

    Ok bear with me here...

    Everything works 100% in OpenGl. However I need to use Direct3D9 because otherwise I can't see certain effects (pretty water) in 3D (120mhz shutter glasses stereoscopic).

    After tinkering with this for days, I've figured out how to get pretty water and the mirror reflections in DX9 using this hack:

    Helix Mod: Quake 1 [DirectQ]

    (I realize this is for DirectQuake and not DarkPlaces. I also didn't even use the ShaderOverride as included, I only used the d3d9.dll file and put that in my main Quake folder.)

    This made certain effects work, but quite wonky.

    The mirror/teleporter reflection was upside down and it seems only certain parts of the player model were seen in the reflection.

    After doing a GLSL and HLSL dump I went through it to see if I can see any differences....but I don't know almost anything about programming so...after a long time the best I could do was change this from the default.hlsl:

    #ifdef USEREFLECTION
    float4 ScreenScaleRefractReflectIW = ScreenScaleRefractReflect * (1.0 / ModelViewProjectionPosition.w);

    to

    #ifdef USEREFLECTION
    float4 ScreenScaleRefractReflectIW = ScreenScaleRefractReflect * (-1.0 / ModelViewProjectionPosition.w);

    Again i don't really know what I'm doing so it was basically luck and some common sense that if it was upside down, changing that might help.

    Now the mirror/teleporter reflection has been flipped - to look like it should.

    Another issue I had before I changed the bit of code is the reflection would move and rotate with the mouse.

    This I'm too clueless to fix. Although changing the above code locks the reflection vertically (when I move the mouse up and down the reflection does not move, however it still moves when I move the mouse left and right).

    I have the same (or similar?) issue with the pretty water (DP Pretty Water v1.2). The reflection works, it's there.....but it moves/rotates with the mouse.

    Here are 2 videos to explain what I mean. Any help on how to figure out (if possible) this last step of getting the reflections to work would be greatly appreciated!

    Teleporter:

    [ame=http://www.youtube.com/watch?v=LDlkckoRQ7c]darkplaces 2013-05-02 14-44-51-85 - YouTube[/ame]

    Water:

    [ame=http://www.youtube.com/watch?v=h50RScbkB0I]darkplaces 2013-05-02 14-46-14-58 - YouTube[/ame]

  • #2
    Hello GapeKing,

    I see your desperate need for help with this issue.
    You struggled for so long, and noone here seems to be able to help you with the last step.
    (By the way, inside3d would maybe have been more efficient)

    It is without a doubt a question for this person: click

    The important shader key word, that is used for this, is made by him (for his engine).
    The fact, that it works with OpenGL and not in DX mode must be explained/studied by himself.

    Please send a message his way and he will surely give you an answer.

    Good luck,
    Seven

    Comment

    Working...
    X