Baptiste

10-25-2016, 06:55 AM

Hi,

I'm having issues with a line when I put reflection on my truck. hpics.li/136d5b2 (I remove the http)

I calculate reflected vectors with normals (which become also texture coordinates after a small function), I investigated the bug and I found that the texture coordinates (my reflected vector) go from 0 through 1 exactly on this line hpics.li/700e682 (you see the tex coord). It's not a problem of GL_CLAMP or anything like this(GL_NEAREST ...). The problem is more complex : because of the texture coordinates discontinuity, when I call the function "texture" the length of the derivative vector is huge so OpenGl choose the smaller mipmaps for this frament which is a 1*1 pixel , and I so the final result is a line.

The first solution is to fix the GL_TEXTURE_MAX_LEVEL to a small number like 3 or 4 with a 2000*1000 texture (the sky) but this is a ugly solution cause it causes some glittering.

Does anyone have an idea for me ?

Thank you to all of those who read my message and I hope there is a solution.

Baptiste

I'm having issues with a line when I put reflection on my truck. hpics.li/136d5b2 (I remove the http)

I calculate reflected vectors with normals (which become also texture coordinates after a small function), I investigated the bug and I found that the texture coordinates (my reflected vector) go from 0 through 1 exactly on this line hpics.li/700e682 (you see the tex coord). It's not a problem of GL_CLAMP or anything like this(GL_NEAREST ...). The problem is more complex : because of the texture coordinates discontinuity, when I call the function "texture" the length of the derivative vector is huge so OpenGl choose the smaller mipmaps for this frament which is a 1*1 pixel , and I so the final result is a line.

The first solution is to fix the GL_TEXTURE_MAX_LEVEL to a small number like 3 or 4 with a 2000*1000 texture (the sky) but this is a ugly solution cause it causes some glittering.

Does anyone have an idea for me ?

Thank you to all of those who read my message and I hope there is a solution.

Baptiste