Repeat texture in shader with linear filter in webgl -


I am trying to repeat my simple texture in my shader and get annoying results  line

Texture wrap property is set to CLAMP_TO_EDGE because I can not be sure of the size of the image - and to reuse the image it should have 2 size power.

Use this piece of code for my piece

  Uniform Sample 2D Texx 1; Zero main () {gl_FragColor = texture2D (tex1, fract (gl_TexCoord [0] .xy * 2)); }   

The result is:

result

Problems are joints when repeat starts (marked in red) when the filter is the closest, there is no problem - the edges are not easily made so that there is no problem.

I created my image in 16x16 size - only to be able to use the REPEAT filter, and the results are good as shown here.

Expected Result

In my actual application, I'm choosing to repeat the image and it does not need to be operated by 2 sizes.

Also, when I'm using any other app texture atlas, the REPEAT filter is not good anyway. Because I'm cutting a piece of texture and repeating it.

Can anyone solve this problem?

Thank you,

If you do not have data to binary data , Then you can not do the interpolt. This happens when you gl. CLAMP_TO_EDGE do the edges, you are only in the middle of each other with the data of the edge, not the 'next' texture

three options are given

  1. Assign the texture in a second texture that has 2 textures, but then you have double AA
  2. apply your own repeat and projection algorithm inside the shader. I am betting that this is a slow option.
  3. After painting the texture, blur the edges or cover a little texture and mix it, though I do not think it should always look as though. I will not go for myself

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -