Ugly Pixel light Shader Problem!

Hi there. I’m having some Pixel Shading and Normal Mapping problems.

Basically I have a planet with a bump map texture (and it is UV mapped). When I apply both Pixel Shading (which I sorely need for my sun light) and the bump map (which greatly increases the quality) I get strange shading errors along the seam of the UV and the top and bottom of the planet…



Any body got any ideas how to solve this??? :frowning: :frowning:

Make a new UV with a better hidden seam, and check your vertex normals.

What exactly do you mean better seam? I’ve used blender. But all other shaders have no problem at all. Just this set up.

As for vertex normals… I’m pretty sure they’re correct. But I’ll go check.

I think Oblivionfeet is right, looks like normals/smoothing issues is causing the “fan” effect at the top and the crease on the side of the other object is caused by poor seam placement.

One thing to try first is to reimport the Blender model and be sure to check the “Calculate Normals” box and experiment with the “smoothing angle” slider. I often find that smoothing gets messed up when importing from blender so I use those settings to fix things.

/facepalm

I just noticed the problem!

Your normal map isn’t a normal map. You’ve just got a regular image in there, fix that and use a proper tangent space normal map and it’ll solve most if not all of the issues you’re having (though I would certainly still deal with that seam!).

oh. Sorry. I was only using that as a test image for the time being. Could you point me in the direction of how to make a tangent space normal map???

I’ll do this too. Thanks! :slight_smile:

Ok well firstly, when dealing with Unity, you’ll see people throw the words bump map and normal map around. What they mean is normal map, it’s the same thing in Unity, just gets named differently.

In pre-rendered circles, bump maps and normal maps really are separate things.

That needs mentioning cause you’ll see it a lot.

There’s a couple of ways to make a normal map. Either by baking high polygon details onto a low polygon object, or by converting a grayscale image into a normal map.

Ironically while the first method is ultimately more accurate, the second method tends to give better results.

Since the first method requires a pretty good understanding of modeling to begin with, and depends entirely on the package used as to how it’s done. Your best bet, for now, is to use the second method.

To do that, you need to create an image where black is low and white is high, like a height map. Import it into Unity, and go to it’s texture options. Right at the bottom, just above the small preview of the texture, you’ll find an option called Generate Bumpmap, tick that.

For bumpiness, generally best to select a very low setting, something like 0.02 for now, you can always fine tune it later, but high bumpiness rarely looks good.

For Bump Filtering, Sobel tends to give cleaner results, but the choice is yours.

When you click Apply, that’ll convert the grayscale image into your normal map, which you’ll then use in the Bumpmap slot of a material. It’s also a good idea to use RGB16 or 24 rather than the compressed texture formats, because the compression really screws up a normal map.

When you’ve got your normal map applied in your material, check all around your model. This is where good UV mapping is essential, a tangent space normal map will show up seams very easily. You can sometimes minimize them by using 180 degree smoothing on the mesh in Unity, but often you wont be so lucky. Though I’ve found that creating the normal map from a grayscale image within Unity, tends to avoid a lot of seam problems. But with your UV seam going right through the center of your planetoid, it’s likely going to be very noticeable.

Ok. That fixed it up nicely!! :smile: My only problem now is that the resolution of my file is way to small to get good enough bump detail.

Appart from that… well it cleared all the seam problems!!! :slight_smile: Thank you very much!

Awesome! Glad it worked out :smile: