Update shaders_deferred_render.c
This commit is contained in:
parent
68b6c79c3f
commit
4805dddc18
1 changed files with 8 additions and 5 deletions
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#define MAX_CUBES 30
|
#define MAX_CUBES 30
|
||||||
|
|
||||||
|
// GBuffer data
|
||||||
typedef struct GBuffer {
|
typedef struct GBuffer {
|
||||||
unsigned int framebuffer;
|
unsigned int framebuffer;
|
||||||
|
|
||||||
|
@ -43,6 +44,7 @@ typedef struct GBuffer {
|
||||||
unsigned int depthRenderbuffer;
|
unsigned int depthRenderbuffer;
|
||||||
} GBuffer;
|
} GBuffer;
|
||||||
|
|
||||||
|
// Deferred mode passes
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DEFERRED_POSITION,
|
DEFERRED_POSITION,
|
||||||
DEFERRED_NORMAL,
|
DEFERRED_NORMAL,
|
||||||
|
@ -270,9 +272,9 @@ int main(void)
|
||||||
}
|
}
|
||||||
rlDisableShader();
|
rlDisableShader();
|
||||||
EndMode3D();
|
EndMode3D();
|
||||||
|
|
||||||
DrawText("FINAL RESULT", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("FINAL RESULT", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DEFERRED_POSITION:
|
case DEFERRED_POSITION:
|
||||||
{
|
{
|
||||||
DrawTextureRec((Texture2D){
|
DrawTextureRec((Texture2D){
|
||||||
|
@ -280,9 +282,9 @@ int main(void)
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("POSITION TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("POSITION TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DEFERRED_NORMAL:
|
case DEFERRED_NORMAL:
|
||||||
{
|
{
|
||||||
DrawTextureRec((Texture2D){
|
DrawTextureRec((Texture2D){
|
||||||
|
@ -290,9 +292,9 @@ int main(void)
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("NORMAL TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("NORMAL TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case DEFERRED_ALBEDO:
|
case DEFERRED_ALBEDO:
|
||||||
{
|
{
|
||||||
DrawTextureRec((Texture2D){
|
DrawTextureRec((Texture2D){
|
||||||
|
@ -300,8 +302,10 @@ int main(void)
|
||||||
.width = screenWidth,
|
.width = screenWidth,
|
||||||
.height = screenHeight,
|
.height = screenHeight,
|
||||||
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
}, (Rectangle) { 0, 0, screenWidth, -screenHeight }, Vector2Zero(), RAYWHITE);
|
||||||
|
|
||||||
DrawText("ALBEDO TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
DrawText("ALBEDO TEXTURE", 10, screenHeight - 30, 20, DARKGREEN);
|
||||||
} break;
|
} break;
|
||||||
|
default: break;
|
||||||
}
|
}
|
||||||
|
|
||||||
DrawText("Toggle lights keys: [Y][R][G][B]", 10, 40, 20, DARKGRAY);
|
DrawText("Toggle lights keys: [Y][R][G][B]", 10, 40, 20, DARKGRAY);
|
||||||
|
@ -333,4 +337,3 @@ int main(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue