diff options
| author | Ray <[email protected]> | 2022-07-04 17:47:47 +0200 |
|---|---|---|
| committer | Ray <[email protected]> | 2022-07-04 17:47:47 +0200 |
| commit | c6c71fe73c897981c2ddfb40dd82cc09c61f8aff (patch) | |
| tree | 8a32fee110dd5ef795dbdeccb1e53d534a074729 /examples/shaders/shaders_mesh_instancing.c | |
| parent | 850321cf2b8b8af8a645666b5bfa758057cf8258 (diff) | |
| download | raylib-c6c71fe73c897981c2ddfb40dd82cc09c61f8aff.tar.gz raylib-c6c71fe73c897981c2ddfb40dd82cc09c61f8aff.zip | |
REVIEWED: `DrawMesh()` #2511
Disable color vertex attribute if not provided by mesh
Diffstat (limited to 'examples/shaders/shaders_mesh_instancing.c')
| -rw-r--r-- | examples/shaders/shaders_mesh_instancing.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/examples/shaders/shaders_mesh_instancing.c b/examples/shaders/shaders_mesh_instancing.c index c1e48c02..08618d6e 100644 --- a/examples/shaders/shaders_mesh_instancing.c +++ b/examples/shaders/shaders_mesh_instancing.c @@ -19,7 +19,6 @@ #include "rlights.h" #include <stdlib.h> // Required for: calloc(), free() -#include <math.h> // Required for: #if defined(PLATFORM_DESKTOP) #define GLSL_VERSION 330 @@ -27,7 +26,7 @@ #define GLSL_VERSION 100 #endif -#define MAX_INSTANCES 8000 +#define MAX_INSTANCES 10000 //------------------------------------------------------------------------------------ // Program main entry point @@ -87,7 +86,9 @@ int main(void) matInstances.shader = shader; matInstances.maps[MATERIAL_MAP_DIFFUSE].color = RED; - // Create a defult material with default internal shader for non-instanced mesh drawing + // Load default material (using raylib intenral default shader) for non-instanced mesh drawing + // WARNING: Default shader enables vertex color attribute BUT GenMeshCube() does not generate vertex colors, so, + // when drawing the color attribute is disabled and a default color value is provided as input for thevertex attribute Material matDefault = LoadMaterialDefault(); matDefault.maps[MATERIAL_MAP_DIFFUSE].color = BLUE; |
