Skip to content

Commit

Permalink
Update shaders_deferred_render.c
Browse files Browse the repository at this point in the history
  • Loading branch information
raysan5 committed Oct 31, 2023
1 parent aca854c commit df0f7ba
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/shaders/shaders_deferred_render.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@

#include <stdlib.h> // Required for: NULL

#define MAX_CUBES 30

typedef struct GBuffer {
unsigned int framebuffer;

Expand Down Expand Up @@ -144,18 +146,18 @@ int main(void)
lights[2] = CreateLight(LIGHT_POINT, (Vector3){ -2, 1, 2 }, Vector3Zero(), GREEN, deferredShader);
lights[3] = CreateLight(LIGHT_POINT, (Vector3){ 2, 1, -2 }, Vector3Zero(), BLUE, deferredShader);

const int MAX_CUBES = 30;
const float CUBE_SCALE = 0.25;
Vector3 cubePositions[MAX_CUBES];
float cubeRotations[MAX_CUBES];
Vector3 cubePositions[MAX_CUBES] = { 0 };
float cubeRotations[MAX_CUBES] = { 0 };

for(int i = 0; i < MAX_CUBES; i++)
for (int i = 0; i < MAX_CUBES; i++)
{
cubePositions[i] = (Vector3){
.x = (float)(rand()%10) - 5,
.y = (float)(rand()%5),
.z = (float)(rand()%10) - 5,
};

cubeRotations[i] = (float)(rand()%360);
}

Expand Down

0 comments on commit df0f7ba

Please sign in to comment.