Question

I have a shader i wrote, using the normal map generated by 3ds max. I get seamless results on windows, but i've seen seams on macs. Is this something that could be related to the directon i develop my normal map, (but then again i believe that i am running chrome in opengl mode), or some kind of precision issue? Is there any way of debugging this without a mac?

Per gmans answer below, i've added

gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);

The link is here.

webgl normal map seam

Was it helpful?

Solution

Is it possible it's a color space conversion issue?

By default some browsers apply colorspace conversions when they load images. That's fine if you're just displaying an <img> tag but no so good for normal maps.

To tell WebGL to not allow to the browser to apply colorspace conversions you call

gl.pixelStorei(gl.UNPACK_COLORSPACE_CONVERSION_WEBGL, gl.NONE);

The default is that colorspace conversions are allowed (as in browser specific).

See the WebGL spec

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top