With the help of ChatGPT-4, I created a headlamp for my first-person character that illuminates static meshes just fine. However, when I attempt to illuminate a procedurally generated mesh, only the bottom of the cone works: the lighting is cut off about a meter off the ground. The attached screenshot shows the problem where I am aiming the character at a wall with a ramp beside. Everywhere in the procedural house is the same, but it looks great in daylight. A frame with a picture on the wall is illuminated fine in the procedural house as well, just not the walls. With the help of ChatGPT-4, we tested many hypotheses, but could not identify the problem. A point light dragged into the scene does the same thing: only the bottom metre or so of the wall is lit. This is not a reflection off the floor, because I can bring the light close and have just the wall lit, an arc at the bottom, and a line across.
Problem solved. The winding order of my procedural meshes was correct, which is why daylight lit them correctly. But I had forgotten to pass the normals array to UProceduralMeshComponent::CreateMeshSection_LinearColor(), which it needed in order to light the procedural meshes correctly using a spotlight or point light.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.