[Committed] RTT && multisampling

according to:



http://www.jmonkeyengine.com/forum/index.php?topic=12080.0



This adds to jme 2.0 the capability of multisampling (anti aliasing) in FBOs (RTT).



patch:

http://pastebin.com/m7b7f7949

On another note: I didn't transfer this to the JOGLTextureRenderer, it will just ignore the multisampling argument. I cannot test anything with JOGL since I never got it to run. So, it would be great if someone could port the changes to JOGLTextureRenderer, (gouessej).  :wink:

Rev. 4729 of src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java has broken initial rendering, at least with LWJGL SimpleGame on Linux AMD64.



I'd appreciate it if somebody could try this out on Windows.  It's very easy to reproduce on Linux.  With jME 2 trunk, run the testchooser, select the Triangle Strip demo or the Morph demo (most of the demos would probably do the same).  Nothing appears until you hit F4 (which you can toggle right off again if you wish to).  Note that the Morph demo does not even use texturing-- it uses vertex coloring.



I've narrowed the problem to rev 4729 of LWJGLTextureRenderer.java because the problem goes away if I revert this file to rev 4728 and remove the new samples cons parameter from inside LWJGLDisplaySystem.java.

blaine said:

Rev. 4729 of src/com/jme/renderer/lwjgl/LWJGLTextureRenderer.java has broken initial rendering, at least with LWJGL SimpleGame on Linux AMD64.

I'd appreciate it if somebody could try this out on Windows.  It's very easy to reproduce on Linux.  With jME 2 trunk, run the testchooser, select the Triangle Strip demo or the Morph demo (most of the demos would probably do the same).  Nothing appears until you hit F4 (which you can toggle right off again if you wish to).  Note that the Morph demo does not even use texturing-- it uses vertex coloring.

I've narrowed the problem to rev 4729 of LWJGLTextureRenderer.java because the problem goes away if I revert this file to rev 4728 and remove the new samples cons parameter from inside LWJGLDisplaySystem.java.


Confirmed on OSX, give me a few minutes and I can give it a go on Vista

EDIT:  In Vista I see a dark grey rectangle with some lighting on one sight of it (though enough on the other side to still be dimly visible).  I'm not sure if this is what the entire demo is supposed to be, my hunch would say "no" since its basically a firstpersoncontroller with a plane in the middle of the scene graph.
sbook said:

...

Confirmed on OSX, give me a few minutes and I can give it a go on Vista

EDIT:  In Vista I see a dark grey rectangle with some lighting on one sight of it (though enough on the other side to still be dimly visible).  I'm not sure if this is what the entire demo is supposed to be, my hunch would say "no" since its basically a firstpersoncontroller with a plane in the middle of the scene graph.


I guess you mean the Triangle Strip demo.  Just run the Morph demo.  Do you see a conified monkey or no?

Now that's weird, on OSX it doesn't show suzanne until i hit F4 to see the stats.  Once I do that it appears fine (albeit a bit darker from having the statistics screen overlaid), and continues to function normally after I turn off the stats. I should be able to check on a Windows box a little later

sbook said:

Now that's weird, on OSX it doesn't show suzanne until i hit F4 to see the stats.  Once I do that it appears fine (albeit a bit darker from having the statistics screen overlaid), and continues to function normally after I turn off the stats. I should be able to check on a Windows box a little later


This is exactly what I am complaining about.  Please try a couple other demos to see how general the problem is.  I spent quite a lot of time on this earlier today and don't want to back out my work-around now.
blaine said:

This is exactly what I am complaining about.  Please try a couple other demos to see how general the problem is.  I spent quite a lot of time on this earlier today and don't want to back out my work-around now.


Gotcha, I just reread your post after experiencing it... I thought you had meant that you didn't see anything until you toggled the stats, at which point you saw the stats.  When I saw the problem I immediately thought of something being off in the GameStateManager, but obviously that isn't the case with SimpleGame.

EDIT:  jmetests confirmed unworking in Windows 7 x64 RTM:

  • Morph Test

  • effects.cloth.TestCloth

  • renderer.TestShadowPass (This is the first one that is a "world" as opposed to just a single node in the middle of darkness..  still gets the same result)

  • effects.TestDynamicSmoker

  • renderer.TestMultiTexture


Oddly, all of the water tests seem to be working fine:
  • effects.water.TestQuadWater

  • effects.water.TestSimpleQuadWater

  • effects.water.TestProjectedWater

I'm on it guys, sorry for the trouble.



EDIT: Found immediately. After setting up the FBOs in the constructor, i forgot to switch back to the FBO 0 that is the displaybuffer itself. That meant that the Renderer rendered to the TextureRenderers FBO until the TextureRenderer was used (activating the StatsScreen) and deactivate switched to the FBO 0 after rendering the texture, from which point on it worked properly.



I will test all of the above and commit the fix. Thx for not kicking my butt fellas  :wink:



EDIT again: Committed, sorry for the trouble and thanks for pointing it out to me.

Hi,



just checked the new version in the SVN. LWJGLTextureRenderer is now working properly here.

(MacOSX 10.5)



So the full functionality seems to be back.



  jenne

It's working again.



Many thanks!

It's working now.

RTT multisampling is very useful.

Good job! :-o