Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[models] Built-in 3D models are missing vertex normals #4808

Open
fasterik opened this issue Mar 3, 2025 · 1 comment
Open

[models] Built-in 3D models are missing vertex normals #4808

fasterik opened this issue Mar 3, 2025 · 1 comment
Labels
enhancement This is an improvement of some feature

Comments

@fasterik
Copy link

fasterik commented Mar 3, 2025

While experimenting with the 3D API and shaders, I discovered that my lighting only works with DrawCube and DrawPlane. Doing a Ctrl+F in rmodels.c confirms that these are the only only functions in that file that call rlNormal3f. It appears that other 3D primitives will reuse the last normal output by a previous draw call. I believe the following functions need to be modified to output vertex normals:

  • DrawCircle3D
  • DrawTriangle3D
  • DrawTriangleStrip3D
  • DrawSphereEx
  • DrawCylinder
  • DrawCylinderEx
  • DrawCapsule
@raysan5
Copy link
Owner

raysan5 commented Mar 9, 2025

@fasterik Normals were added quite recently and were not added before to avoid code complexity on those functions. Feel free to improve those functions with normals as required.

@raysan5 raysan5 added the enhancement This is an improvement of some feature label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This is an improvement of some feature
Projects
None yet
Development

No branches or pull requests

2 participants