- Home /
Generated mesh loses lighting at certain angles
Hi all
I'm procedurally generating a single mesh. This mesh is assigned to a MeshFilter which is rendered via a MeshRenderer.
As I rotate the camera around the mesh there is a definite point where the lighting stops being applied:
This strikes me as something that is probably a common rendering issue. The material is the default diffuse, which should rule out any funky shader behaviour.
Is anyone familiar with this issue and any potential fixes?
Thanks, Ves
Answer by VesuvianPrime · Jan 29, 2015 at 05:53 PM
The lighting issues have stopped since using a correct bounding box. I was previously exploiting the bounding box so the geometry would not be culled.
Answer by Eric5h5 · Dec 18, 2014 at 08:13 PM
I would guess the normals aren't calculated correctly.
I'm pretty confident the normals are correct. Here I'm just using $$anonymous$$esh.Combine to combine a bunch of primitive cubes.
Guess I can write a quick script to visualize the normals.
Alrighty, demonstrating the normals, and adding a cube gameobject for reference:
Yeah, the normals seem O$$anonymous$$. I'm out of guesses.
Your answer
Follow this Question
Related Questions
Realtime lighting with generated mesh causes light bleed at seams / edges (minecraft clone) 2 Answers
Help in understanding Mesh Generation 1 Answer
[SOLVED]Procedural generated side by side cubes without 'seams'? 2 Answers
How to change type of shading? 1 Answer
Procedural Cylinder Generation 2 Answers