JM3 Antialiasing and Texture Renderer


Pb on JME3 (SVN from yesterday)

I create a scene with several nodes/geometries and attached it to rootNode => Antialiasing is OK

I put the same scene on a Texture2D and display it on guiNode => Antialiasing does not work.

I didn’t find any antialiasing options during the Texture Renderer setup.

Did I miss something ?

Tnxs for any input !

You mean it worked before? or you mean you don’t know how to do it?

If it’s the later, you have 2 ways to do it :

  • Create a multisampled Frame buffer (you specify the number of samples in the constructor).

    The problem is that prior to ogl3 you can’t attach a texture to a multisampled framebuffer, so you have to create another single sampled frame buffer, attach the texture to this one, and after the render, copy the multisampled framebuffer into the single sampled framebuffer. (It’s done like this in the HDRRenderer)

  • if you are planning to deploy on ogl3, you can just attach the texture to the multisampled frame buffer. But…to read it in the shader, for each pixel, you’ll have to fetch the color of each sample and average the output. (look at the multisampled.glsllib it contains convenient methods to read multisampled textures in a shader).

    If i remember correctly you are working on an android device (maybe i’m wrong). If it’s the case…i’m not sure that ogl 2 ES support multisampled framebuffers, but the first solution should work.

    Hope that helps

It works and it helped ! (First solution).

In fact, I didn’t know how to do it … Thanks for your (very fast) reply nehon !

You are right, in fact I work on Desktop and on Android. I’ll check on Android when the render process will be fixed.

I can ask a second question ? What is the best way to make a Spatial invisible ? Is there a more elegant way than detaching from its parent ?

Tnxs again.

Yes you can set its cullHint to Always, so the renderManager will always discard it from the render.

I’m glad it helps :wink:

Tnxs again Nehon !