Jump to content

How to get a render with sharp pixels without any filter applied


BabyJS
 Share

Recommended Posts

I searched in the forums and the unique thing was this:

Is there anyway to easily set for the render/scene all that we need for get sharp pixels?

I can turn off the Antialias for the rendering. But there is anyway to set Nearest.Samplingmode or turn off the image smoothing, anisoptric filtering or other default filters of Babylon.JS ?

In the same way i can turn off the antialias is there anyway to turn off that filters in one function?

Link to comment
Share on other sites

Oh! So, for each texture i have to set NEAREST_SAMPLINGMODE and deactivate the anisotropic filter( i guess TextureName.anisotropicFilteringLevel=1) ? :o Why there is no function like the antialias to set true/false that filters?

There are other filters that Babylon.js applies by default?

Link to comment
Share on other sites

Come one! Maybe people no will ask, but if you make a poll or something sure people will vote for it to have it. I guess i have to find another way.

 

---

 

All textures in my project are 1024x1024 / 512x512 or 256x256 . In Blender the options for Interpolation/Filtering/MipMap, etc... are off when i export the .OBJ, in blender the render looks in real pixels.

Link to comment
Share on other sites

I wanted to help by providing a function for changing all textures in the scene, but it seems that texture.updateSamplingMode is not working.

If I set the sampling mode when creating the texture it works, but if updateSamplingMode is used, there is no effect.

http://babylonjs-playground.com/#121HCT#0

(Playground explanation: left plane is pixalated, here the samplingmode is set on texture loading, right plane is not pixalated here the sampling mode is set after the texture creation.)

This makes it impossible to just iterate all textures and change the samplingmode after a scene is already loaded. (Which is what I had in mind.)

Link to comment
Share on other sites

@Nabroski the SamplingMode, for example in this demo: http://www.babylonjs-playground.com/#1IKIXK#5

If instead Nearest you set to Bilinear they look blurry. Is simply that a way to deactivate the filters or change to Nearest or whatever to have real/sharp pixels without no postprocess of any type.

Also i can't give you an example of my projects because is made in Construct2 using the Babylon3D plugin, so i develop using events and now seems i can add some native babylon functions with the action "execute javascript".

Here is video i uploaded a few hours ago showing my last progress:

And this is a screenshot of how looks the textures:

0db8e23ca8.png

As you can see the texture is blurry.

Link to comment
Share on other sites

6 hours ago, Nabroski said:

@jpdev default renderloop in playground, be aware of it.

http://www.babylonjs-playground.com/#1KDQTU#21

Hi @Nabroski

Using the same event from the pg you linked, "updateSamplingMode" is still not working for a simple texture loaded from a file.

Example playground, click anywhere to trigger "updateSamplingMode" call: http://babylonjs-playground.com/#121HCT#1

As you click you can see, the only texture affected by setting the samplingmode is the one, that was loaded with a different sampling mode.
The default texture does not change sampling mode.

Just to make sure it's not a bug in setting up the textures, here is the pg with only the samplingmode parameter switched between the two texture loads:

http://babylonjs-playground.com/#121HCT#2

Now updateSamplingMode only affects the other texture.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...