user2676299
user2676299

Reputation: 617

Unity photosphere - there is a 1px line appearing

I created a photosphere viewer in Unity and used a custom shader as per https://stackoverflow.com/a/37123903/2676299

Everything looks perfect, except there is a 1px line right at where the image end & start join.

(It's definitely not from the image)

Any ideas?

Update: It appears to be coming from the sphere itself, not the mapping. I changed the shader code to move the coordinates.

 float2 sphereCoords = float2(lon, lat) * (1.0 / PI);
 float2 sphereCoords = float2(lon**+0.2**, lat) * (1.0 / PI);

This rotates the projection of the image a little and separates the sphere splines from the image start/end. Now I can see the image ends meet perfectly and the artifact is still there but not at where the image start meets the end. This isolates the problem to the sphere itself (I guess). I am using the built in Unity sphere with its unmodified default settings.

It is as if one half circle spline going from bottom all the way to the top of the sphere is visible to the camera.

enter image description here

Upvotes: 3

Views: 862

Answers (1)

lockstock
lockstock

Reputation: 2427

This can happen when you have the texture 'Wrap Mode' set to Repeat instead of Clamp.

Repeat will repeat the textures exactly as they are, Clamp will attempt to align the edge pixels to neighbouring textures so that there is a smooth transition, which is almost certainly what you want for a photo-sphere.

Upvotes: 1

Related Questions