3

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
user2676299
  • 617
  • 1
  • 5
  • 14
  • why do you want to use a custom shader out of interest? – lockstock May 04 '17 at 00:58
  • Its the only way I could find to map an equirectangular image to the inside of a sphere. Do you know a better way to pull it off? I am just trying to create a simple VR viewer... – user2676299 May 05 '17 at 10:27
  • Have you tried using a skybox material instead of a sphere? – lockstock May 07 '17 at 12:17
  • Skybox doesn't have this problem... works fine. I had read somewhere that skyboxes will have limitations on the fidelity you can achieve. I am a Unity newbie but my coder instincts tell me it is more managable/modular to get this done with a sphere. But thanks! I had another look at skybox and will move on with it... – user2676299 May 07 '17 at 16:50

1 Answers1

1

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.

lockstock
  • 2,359
  • 3
  • 23
  • 39