Jump to content

[SOLVED] How to prevent texture smearing?


ozRocker
 Share

Recommended Posts

22 minutes ago, fenomas said:

You mean like this? https://www.babylonjs-playground.com/#NXVFFK#1

If so, the clamp mode is the problem. When you set an offset, the edge of the texture moves to the middle of the mesh. Setting clamp mode tells the engine to keep drawing the edge of the texture beyond that point.

I used clamp mode because I don't want the texture to wrap.

Maybe I can add a transparent border to the image texture so only the transparent border will smear

Link to comment
Share on other sites

1 hour ago, ozRocker said:

I used clamp mode because I don't want the texture to wrap.

Maybe I can add a transparent border to the image texture so only the transparent border will smear

When you apply a texture to a mesh, every fragment of the mesh will get painted with a pixel of the texture. Wrapping vs. clamping just changes which pixel. So if you want part of the mesh not to have any texture, you'll need to split the mesh into separate parts, or change the texture to have transparent pixels, yeah.

Link to comment
Share on other sites

Actually, there are problems in this one, which is probably why I'm still struggling with the project I'm on, because even with 5px border of transparency I still see a smear on my mesh.  Because my texture is on a person's body so its not a flat surface.

https://www.babylonjs-playground.com/#NXVFFK#2

In there if you change angle of the camera to look at the side of the ground a smear will appear.  Does anyone know how to prevent that?

EDIT

I got it sorted.  I needed to have a 4 pixel border of transparency.  Works fine now :)

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...