Jump to content

Sprite Atlas vs UVs


mightymarcus
 Share

Recommended Posts

I have a big problem with screen tearing. Please have a look at the video. I am sorry I can't provide a playground for this (yeah I could maybe), because I am using a port of babylonjs together with the haxe language/compiler. I read much information about the problem in OpenGL forums too, but I did not get a solution.

So maybe some 3D WebGL / OpenGL ES Guru knows, how to fix the problem.

 

 

 

As you can see in the video, the mesh with the bricks and ladders is flickering and tearing like hell. The mesh is merged together from single meshes (planes) and a sprite atlas is used, so that I can take one material/texture for the whole level-mesh (the foreground). To get the well known sprite art or retro effect, I use

Texture.NEAREST_SAMPLINGMODE

texture.anisotropicFilteringLevel = 1

texture.wrapU = texture.wrapV = Texture.CLAMP_ADDRESSMODE

I tried to adjust the uvs (read about pixels and texels), but I don't get it right.

I think that the UVs are not correct and when the camera moves, the drawn texture tile is snapping between two pixels all the time, and that causes the bad tearing effect.

But I don't know. Since I am using Babylonjs/Babylonhx, I am asking here for the first place.

It's strange too, that it looks like the lines are jumping up and down. And maybe the uvs are right, but the screen tearing is a evil, that comes with the NEAREST_SAMPLINGMODE or the disabled anisotropicFiltering? Btw. I disabled mipmaps too.

Hm. It would be easier to just scale the Textures up hm and use another sampling mode? Because now I get it, that not using mipmaps is a bad idea, because I have a little 3D stuff in there, like the sides and the floor.

Yeah I know, there is another topic to this topic. But I didn't find the answer there.

Yeah, that's great. I think I have the right solution now. Upscaled textures. But to be honest and just to learn how to do it right, is there another way how I can do this? Merging planes with different uvs together and using a very small texture (one tile = 32px) without having artefacts?

Link to comment
Share on other sites

It's bundled with the Radeon Drivers and is called ReLive. And yes, it's very good. Better as you can see here (Youtube messed the video a little bit up). Last time I recorded the desktop and then I was looking the video. I got to the toilet, came back ... and wtf? Why can't I click? What is wrong here? Uhhh ... it's not the actual desktop. It is the video ... ;)

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