In my latest project I create a floor with cubes and gaps. The cubes move on a line and their length gets scaled by a random number. The texture I’m going to use will be repeated according to the length of the cube. Therefor one cube has four materials for top front/back flanks and bot.
When I added light to my test scene, the cubes which spawned next to eachother looked pretty wierd. See the example picture below:
How can I prevent the single cubes to be seen so obviously? I have no experience with shaders yet so I probably need a lot of help here, but I’m happy about ever reply.
Looks like the normals are messed up, so this isn’t really a shader question. The normals for the top vertices should all be pointing straight upward, and the normals for the side front vertices should all be pointing straight back.
Thank you Eric. This really seems to be the problem. I wrote a short script to debug the normals and found they were of the form (±1, ±1, ±1) with a scale factor instead of unit vectors which I expected. This means when i imported the modell unity took the normals lokated at the vertices instead of the normals of the faces. I changed the import settings for the normals to calculate instead of import. Now the cube has proper normals and the light looks right.