[Chapter 10: Lighting Fundamentals] Suggest to change point size according to distance

Hi Team

(This is just my suggestion, Team can skip it if it’s not really necessary)
In the Point Lights and Spotlights section. I noticed that when I zoom out, the size of the point (Lights) is now bigger than the sphere.

Point is lying on the sphere

My suggestion is to resize point this depending on the distance when user scrolling
Step 1: In Common.h add pointSize property to Uniform structure:
Common.h

Step 2: In Renderer.swift, I took the distance property and put it in Uniform
Renderer.swift

Step 3: And finally in the DebugLights.metal → vertex_debug() I change it to .point_size = 100/ uniforms.pointSize
DebugLights.metal

Step 4: Then build and run, it fixed the above problem
Result

(Again this is just my suggestion, Team can skip it if it’s not really necessary)
Thanks for reading

3 Likes

That’s an excellent suggestion. Thank you for adding it here!

2 Likes

Thank you for sharing information

1 Like