Browse Source

Merge pull request #5085 from Not-Nik/culling_consistency

Make culling distances consistent across raylib
pull/5086/head
Ray 2 months ago
committed by GitHub
parent
commit
cdbe9d75ef
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      src/config.h
  2. +2
    -2
      src/rcamera.h
  3. +1
    -1
      src/rcore.c

+ 2
- 2
src/config.h View File

@ -135,8 +135,8 @@
#define RL_MAX_SHADER_LOCATIONS 32 // Maximum number of shader locations supported
#define RL_CULL_DISTANCE_NEAR 0.001 // Default projection matrix near cull distance
#define RL_CULL_DISTANCE_FAR 10000.0 // Default projection matrix far cull distance
#define RL_CULL_DISTANCE_NEAR 0.05 // Default projection matrix near cull distance
#define RL_CULL_DISTANCE_FAR 4000.0 // Default projection matrix far cull distance
// Default shader vertex attribute locations
#define RL_DEFAULT_SHADER_ATTRIB_LOCATION_POSITION 0

+ 2
- 2
src/rcamera.h View File

@ -65,8 +65,8 @@
#endif
#if defined(RCAMERA_STANDALONE)
#define CAMERA_CULL_DISTANCE_NEAR 0.01
#define CAMERA_CULL_DISTANCE_FAR 1000.0
#define CAMERA_CULL_DISTANCE_NEAR 0.05
#define CAMERA_CULL_DISTANCE_FAR 4000.0
#else
#define CAMERA_CULL_DISTANCE_NEAR RL_CULL_DISTANCE_NEAR
#define CAMERA_CULL_DISTANCE_FAR RL_CULL_DISTANCE_FAR

+ 1
- 1
src/rcore.c View File

@ -1530,7 +1530,7 @@ Ray GetScreenToWorldRayEx(Vector2 position, Camera camera, int width, int height
double right = top*aspect;
// Calculate projection matrix from orthographic
matProj = MatrixOrtho(-right, right, -top, top, mf">0.01, 1000.0);
matProj = MatrixOrtho(-right, right, -top, top, n">rlGetCullDistanceNear(), rlGetCullDistanceFar());
}
// Unproject far/near points

Loading…
Cancel
Save