BabyJS Posted January 18, 2017 Share Posted January 18, 2017 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? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 18, 2017 Share Posted January 18, 2017 Hey! Not really in one function but you can just go through scene.textures and set sampling to nearest mode (http://doc.babylonjs.com/classes/2.5/Texture#updatesamplingmode-samplingmode-rarr-void) Quote Link to comment Share on other sites More sharing options...
BabyJS Posted January 18, 2017 Author Share Posted January 18, 2017 Oh! So, for each texture i have to set NEAREST_SAMPLINGMODE and deactivate the anisotropic filter( i guess TextureName.anisotropicFilteringLevel=1) ? Why there is no function like the antialias to set true/false that filters? There are other filters that Babylon.js applies by default? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 18, 2017 Share Posted January 18, 2017 Because it makes no sense to have it most of the time. In your specific case I can see the value though But it is not a complex task to do it. Quote Link to comment Share on other sites More sharing options...
BabyJS Posted January 18, 2017 Author Share Posted January 18, 2017 I see, well is there any forum or site to request that feature? Or well, i guess you are one of the main developers so will be great if you can add it . Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 19, 2017 Share Posted January 19, 2017 If more people ask for it I will for sure Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 texture has to be power of 2 look for this guy via search in the forum he had a similar issue 1 month ago Quote Link to comment Share on other sites More sharing options...
BabyJS Posted January 19, 2017 Author Share Posted January 19, 2017 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. Quote Link to comment Share on other sites More sharing options...
jpdev Posted January 19, 2017 Share Posted January 19, 2017 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.) Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @Matriax Hello can you give us a screenshot, or, a sample playground project (would be perfect). kind of hard to tell, whats going on, just reading your description of the issue. @joshcamas Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @jpdev default renderloop in playground, be aware of it. http://www.babylonjs-playground.com/#1KDQTU#21 Quote Link to comment Share on other sites More sharing options...
BabyJS Posted January 19, 2017 Author Share Posted January 19, 2017 @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: As you can see the texture is blurry. Quote Link to comment Share on other sites More sharing options...
Nabroski Posted January 19, 2017 Share Posted January 19, 2017 @Matriax i have no idea. hope someone will catch up soon. удачи Quote Link to comment Share on other sites More sharing options...
BabyJS Posted January 19, 2017 Author Share Posted January 19, 2017 This is the texture i'm using 1024x1024 and the mesh is an .OBJ file, a simply cube. Quote Link to comment Share on other sites More sharing options...
jpdev Posted January 19, 2017 Share Posted January 19, 2017 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. Wingnut 1 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2017 Share Posted January 23, 2017 Ok let me check what is going wrong... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted January 23, 2017 Share Posted January 23, 2017 ok it was a bug.. now you can go through all textures and flag then as unfiltered with this little function: http://babylonjs-playground.com/#121HCT#3 (don't forget to wait for texture to be loaded before changing the sampling mode) jpdev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.