Letters blurred while using dynamic texture

First of all in your PG #5ZCGRM#2627 line 40 is incorrect. It should be null not “null”. Comment out line 40 and then if you rotate the camera with the mouse and look closely you can see the image in one of the corners.

Leave line 40 commented out and check out the texture node in the inspector

You will see that the image is only a small section of the texture. It is all to do with the size of the image and the dynamicTexture size. In the following PG I have made the ground smaller by a factor of 10 and moved the camera in closer so that you can see what is happening

You could do something like this

3 Likes

Thank you @JohnK . I do have another doubt regarding the same.

Like, is there anyway to add the image using extra texture or something, just having this doubt because, currently the dynamic texture will apply for both image and text right?

Sorry do not understand what you need. Working with a dynamicTexture you are actually working with a canvas, perhaps the following will help you see what is possible

If I can allow myself, I think you are just complicating things for nothing (sry).
I mean @JohnK gave you the solution for it and a solution that works.
In my opinion (my opinion only), working the text as an overlay makes much more sense, is easier to handle and maintain and would also eliminate all problems related to how the ground texture is displayed vs the text (overlay). Again, my thoughts only.
Meanwhile, have a great day :smiley:

but, i heard dynamic textures are the best way to write texts. Are there anything else? other than meshwriters.?

I am not saying you should switch to another method. The other method in my opinion would be to use the advancedDynamicTexture. But this method is already partly implemented and would work perfectly fine. All I’m saying is that you should not apply it to your ground (image textured) mesh but rather create a second mesh (actually plane) with a tiny offset on top of your ground and use this only for your texts.
By doing this, you can update your ground texture the way you want without impacting the text overlay and the other way round. To me, it would feel a lot easier to manage and maintain (and also makes more sense since the text is rather linked to objects in the scene and not so much to the display of the ground texture.

2 Likes

@mawa is suggesting this type of method

1 Like

Sure, i will do it such a way

Thank you, John. will update to this way

You can always leverage the canvas context and apply a filter for the blur this way. It doesn’t give you the opacity blend like it would in CSS but it does give you a cool effect. Just expanding on JohnK 's, I added the line: dynamicTexture.getContext().filter = ‘blur(7px)’;

https://www.babylonjs-playground.com/#TMHF80#1316

1 Like