TestProjectedWater problem

I was so impressed with the projected water in TestProjectedWater that I decided to try make it run in Swing frame. I used JmeSwingTest as base and added the projected water code there. Unfortunatelly, I get the water very dark and the test objects white. Does someone know why? So far I suspect that in all non swing examples, the display is created using this:

display.createWindow( properties.getWidth(), properties.getHeight(),

                    properties.getDepth(), properties.getFreq(), properties

                    .getFullscreen() );

          and for Swing the code is like that:

display = (LWJGLDisplaySystem)LWJGLDisplaySystem.getDisplaySystem();



Can someone shed some light on this?



Thanks,

Stefan

       

To make sure I use the same example code, I have made a class Water2Orig that does all the work. The class that uses non-swing window is SampleWindow3 and the class that uses Swing window is SwingTest2. They both are kept simple and use Water2Orig, so everything in building the scene and rendering passes is the same, because is done in WaterOrig. Here are the screenshots:


  • SampleWindow3 using Water2Orig:




  • SwingTest2 using Water2Orig:







    As you can see, in the swing case, the water is non transparent, sky reflections are gone and the objects are white.



    The code is zipped here:

    http://rcflightsim.com/water.zip



    Please help, I am stuck on this and have no idea where to look.



    Stefan








Ping ping … No ideas so far ? I am getting desparate.

can you post up the code whereby you attach things to various nodes, suspect it might be an inherant render state thats the issue

The code is zipped here:

http://rcflightsim.com/water.zip

No one knows so far? Has someone ever tried water in swing?


Hmmm… From all I see  there should be number of  strong developers on JME. Too nice for being dead… Is JME dead?  (Now they are going to jump on me… or are they?)

skirtz said:

Hmmm.. From all I see  there should be number of  strong developers on JME. Too nice for being dead... Is JME dead?  (Now they are going to jump on me... or are they?)


You speak heresy my friend.  :P  I think the people that really understand how water works in jME is quite low (or maybe I would just like to think that since I know so little about it), so be patient and hopefully Mr. Coder will come to the rescue. ;)

I know, the only way the water god may shed some light is if I speak heresy… I am so complettely lost (and cluless)  at this shader stuff, I have no chance to find out what is the problem.  I really hope the guy who wrote that water test to take a look and help.

Ping…Ping…Ping…

Ricochet rabbit? :wink:



I think your speaking of heresy has led Mr. Coder to abandon you to your depravity.  :stuck_out_tongue:



He probably just still hasn't either had time or taken notice. MR. CODER - Where are you? 

Hi



you are missing the class Water2Orig in the zip file…

theprism said:

Hi

you are missing the class Water2Orig in the zip file.....

Thanks ! I updated the zip filw by adding Water2Orig.java The zip file with the tests is here: http://rcflightsim.com/water.zip

Stefan

Mr. Coder,



Can you please help? Why is the water shader not working in Swing? Hope you have time to take a look.



Many thanks,

Stefan

works perfectly for me.



should probably go through all of your xxx.class.getClassLoader().getResource and fix those, for correctness.

MrCoder said:

works perfectly for me.

should probably go through all of your xxx.class.getClassLoader().getResource and fix those, for correctness.

Mr. Coder,

Thanks for looking into it!

Can you please post your Swing sample with Water that worked? I tried again the code from http://rcflightsim.com/water.zip (ran SwingTest2) and I still get this:
- The water is not transparent
- The water color is gone
I wonder (excuse my ignorance, I have no experience with shaders) - is the shader working or not? It this effect from the shader, or Jme renders differently in Swing mode (with Implementors) - I get the water demo working on my computyer in normal non-swing window (as shown in my first message).


Stefan

from the screenshots it seems the reflection and refraction textures(from the render to texture operation) is just black. and also, the textures on the objects are missing.

i'll try from home and see if i get any worse results there

Hi Mr. Coder,



I cleaned code for swing/windows water test, please let me know if it runs well on your system.



There are two tests:



- WaterWindowTest that uses LWJGL window;
- WaterSwingTest that uses Swing window;

Both classes are intentionally kept simple and use Water class to manage and render the water.

On my computer, WaterWindowTest works fine, and WaterSwingTest displays black water, no transparency and missing textures.

Here is WaterWindowTest main class:

package testswingwater;
import com.jme.renderer.Camera;
import com.jme.renderer.ColorRGBA;
import com.jme.system.DisplaySystem;

public class WaterWindowTest {
protected DisplaySystem display;

Thanks MrCoder and all who responded,



I tried the current jME version and both test run fine now. My mistake, I am not used to such active development team and did not expect much changes… Hmmmm, again… I am surprised in nice way…

I looked and I found that the problem was in LWJGLTextureRenderer, in my version, in render method, there was:



//activate();  - well, this activate - when commented out made my swing water test to run as well…

doDraw(spat);





Looks the new LWJGLTexture renderer is changed quite a lot and indeed, it works now. Thanks all again.



Stefan

good to hear! that would have been a hard bug to find for us :slight_smile: