Screen Smoothing (Retro-Games mode)

Hello everyone!
I could proceed with my old style survival horror engine, I just have only a little problem, because I wanted to try even with a zoomed pixels graphics (like alone in the dark trilogy), for this I set the resolution something like 320x240 and fullscreen, but interpolation is not good, what I obtained is this:

But what I want is this:

Are there some easy tricks for a NN interpolation (the man is a 3d model, and the background a 2d quad with texture, I need NN interpolation for everything )

Sorry first image wasn’t uploaded correctly, in any case is like the second but with blur between pixels

maybe this could help:

http://hub.jmonkeyengine.org/forum/topic/shader-pixelation-filter/

Sounds cool!
In this way I can keep all my backgrounds in HD graphics, and apply the shader for play in old style modality, thank you very much! I will try soon as possible

Ok I tried something in this way, but I got some problem with multi viewports.
I will try to solve it anyway, but is there a way to make it without filters? I mean just display a low resolution (something like 320x240) in fullscreen mode without smoothing? (so, a nearest neightbour interpolation for backgrounds and 3d models).

Thank you again!

@Ray1184 said: Ok I tried something in this way, but I got some problem with multi viewports. I will try to solve it anyway, but is there a way to make it without filters? I mean just display a low resolution (something like 320x240) in fullscreen mode without smoothing? (so, a nearest neightbour interpolation for backgrounds and 3d models).

Thank you again!

Since we couldn’t really see the original image with the issue, it’s hard to say what your problem is. It could be that you are turning AA on (which will ruin anything you do) or that you just have left filtering on for your textures.

It’s kind of funny that we can’t actually see the image with the problem. :slight_smile:

Probably,
disable filtering of the texture,
make sure you have a multiple of the resolutions, eg 2x2 pixels for each original.

However the pixelation shader allows for soe nice effects, eg blending it dynamically in and out, depending on game situation.

Sorry I hoped was clear even without the image :smiley:

Now I don’t have the original one of my engine, but I hope this could makes the idea

I want to render my little scene (320x240) in fullscreen, what I want to obtain is a pixelation like the image on the left (nearest neighbor), but what I’m obtaining is like the image on the right (bilinear).
I’m simply looking for a way to change the interpolation mode (I have a 2d background and some 3d objects on)

Oook, for disable filtering how can I do? There’s a simple method that will disable the bilinear filter for all the rendered scene? I checked a lot but I couldn’t find any example

Thank you very much

get the Texture object, and set the filters there.

rootnode -> something -> geometry -> material -> textures -> setMagFilter(Nearest)
of curse this can be severably shortcutted, if you setup the Material somewhere manually, as you can just set those values there.

eg similar to

final Texture2D tex = (Texture2D) VGSGUIManager.getInstance().getAssetManager().loadTexture(key);
assert tex != null : "Cant load " + imgName;
tex.setMagFilter(MagFilter.Nearest);
tex.setMinFilter(MinFilter.Trilinear);
@Ray1184 said: Sorry I hoped was clear even without the image :D

Now I don’t have the original one of my engine, but I hope this could makes the idea

I want to render my little scene (320x240) in fullscreen, what I want to obtain is a pixelation like the image on the left (nearest neighbor), but what I’m obtaining is like the image on the right (bilinear).
I’m simply looking for a way to change the interpolation mode (I have a 2d background and some 3d objects on)

But you see… now you are showing us a sprite that is basically emulating what you described. If we could see the actual scene then we might see how the edges of things are rendered to tell you if you have AA on.

This image that you’ve now provided is really no different than if I doctored something up in photoshop to illustrate a point. It includes all of your potential assumptions and none of the reality. That’s why the original screen shot would have been important.

The link you provided actually works but it’s a tiny image. I can’t be sure that my zooming isn’t adding the AA related artifacts I’m seeing or not.

At any rate, make sure the Disabled, x2, x4, etc. drop down in the display settings dialog is set to “Disabled”… or nothing you do will make any difference.

AA is already disabled, I can see the clean boundary of the models. But this is not a problem of AA, is of filtering. I’ve to simulate a clean pixel zoom without the smoothing, I think Empire Phoenix solution is what I already saw, but I’ve some problem…

I made my model with blender, with only materials and no textures, here my problem infact is on the the edges of the model, infact if I want to simulate a 3x/4x zoom on the scene I see all models edges smoothed, and no with clean edges.

Thanks

@Ray1184 said: AA is already disabled, I can see the clean boundary of the models. But this is not a problem of AA, is of filtering. I've to simulate a clean pixel zoom without the smoothing, I think Empire Phoenix solution is what I already saw, but I've some problem...

I made my model with blender, with only materials and no textures, here my problem infact is on the the edges of the model, infact if I want to simulate a 3x/4x zoom on the scene I see all models edges smoothed, and no with clean edges.

Thanks

First you say you don’t have AA enabled and then you describe a problem that sounds exactly like what you’d see with AA enabled.

…this is why we need to see a real picture. Please post one before continuing.

Ok I could upload some new images just now.

Background image is 320x200 res, even the app resolution.
AA is disabled (gameSettings.setSamples(0):wink:

So my situation is this:

I want to toggle fullscreen and obtain this:

but I’m obtaining this:

Moreover, even with disabled AA I could see AA on the player (but this I think is for my graphics card, because I tried on another PC with the same settings and AA of player is disabled correctly)

EDIT: AA disable for player is solved, It was a default setting of my video card, but I always obtain the second result, so AA is not the problem.

Hopefully you understand why I pushed for an image now. If the guy is a model then your image shows AA issues… the rest looks like the min filter:

Looks like texture filtering,

after loding the blender models, do some processing, involving a recurisve method goind down to all geometrys, and then getting their material, then et all matparams check fi they are a texture, and if, get them, and set their filtermode to what you want. (and export with bianryexporter I suggest to do this with a modelcompiler like mini program, and only release the exported j3os)

Ok I did like you suggest, but the problem is that for the model I don’t have any texture, there are all the MatParams of all geometries obtained from the blender model:

MatParam: Specular - Inst: com.jme3.math.ColorRGBA
MatParam: Ambient - Inst: com.jme3.math.ColorRGBA
MatParam: Diffuse - Inst: com.jme3.math.ColorRGBA
MatParam: UseMaterialColors - Inst: java.lang.Boolean
MatParam: ParallaxHeight - Inst: java.lang.Float
MatParam: GlowColor - Inst: com.jme3.math.ColorRGBA
MatParam: Shininess - Inst: java.lang.Float

Is this all done with vertex colors? They use http://de.wikipedia.org/wiki/Gouraud_Shading so they are kinda interpolated.

For models I just applied blender material without textures. In this way is not possbile to solve? If I can set filter only to textures maybe I could apply to the model some simple textures with only one color and try in this way. What do you think about this way?

Thanks again very much

Maybe show us what the mesh looks like for that scene. Wire frame would be very useful.

There is definitely a texture on the floor and it has a min filter that is causing the blurring. Either that or you have way too many triangles.