3
\$\begingroup\$

I'm making a game in Unity that involves lots of spheres. Said spheres will have lighting applied to them, but will also be viewed from only one camera angle. Right now, the full spheres look something like this when textured, normal-mapped, and lit:

Full sphere (correct)

This is correct. The spheres in my game will only be seen head-on, thus I only need to render their top halves.

However, if I use the same material on only half a sphere (with a lower resolution, mind you), I get something like this:

Half sphere (incorrect)

(It's not the exact same material, but it's close enough, and shows the same problem.)

This is incorrect. The weird part is I only encounter this issue in compiled builds of the game; in the editor, the hemisphere is textured exactly as I expect.

At the request of a commentator, here is one of the textures I'm using:

Texture

I'm also using it as a normal map.

My question is thus: how can I make (or where can I find) a hemisphere that can be properly textured, and why does my current hemisphere mesh only render properly in the Unity editor?

\$\endgroup\$
  • \$\begingroup\$ Are these spheres actual 3d meshes? Where are you making the spheres? Are you using the default Unity Spheres? Are you making them in 3d max or Blender? Or some other way? What is the UV layout of these spheres. How exactly did you apply a material to only half the sphere, and why? \$\endgroup\$ – Školstvo Dec 26 '15 at 20:01
  • 1
    \$\begingroup\$ I made the mesh in Blender; I literally just took a sphere and cut out half the vertices, then threw it into Unity. I don't recall doing anything about the UV layout. And I applied the material to the whole mesh, which is half a sphere. (I'm trying to use half a sphere as a performance optimization.) \$\endgroup\$ – JesseTG Dec 26 '15 at 20:03
  • 1
    \$\begingroup\$ No, I don't believe so. I'm literally just setting the relevant prefab to use this half-sphere in a mesh filter, then picking a material to use for it. \$\endgroup\$ – JesseTG Dec 26 '15 at 20:06
  • 1
    \$\begingroup\$ Sure, gimme a minute. \$\endgroup\$ – JesseTG Dec 26 '15 at 20:09
  • 1
    \$\begingroup\$ To be honest, it was a while ago, I don't remember how I did it. \$\endgroup\$ – JesseTG Dec 26 '15 at 20:21
4
\$\begingroup\$

You shouldn't really worry about cutting of the other half of the sphere since Unity doesn't render faces that are looking away anyway. That doesn't solve your problem however. Try to save your sphere as a .blend file. Or if you did that, export it as an .fbx.

If you really want to save resources you should bake(bake texture) your full sphere unto a halfsphere that has had "project from view" unwrap applied. Then you also save texture memory where the biggest performance hit comes from. Forget about saving polygons. Generally they don't matter.

EDIT: I think I figured it out. You used the default Unity Spheres first. But exported the halfspheres from Blender. If that is the case. Then add a fresh "UV Sphere" in blender. Press U and click Sphere projection. Then cut half the faces off. Or better yet, follow my baking advice.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.