Update shaders_basic_lighting.c
This commit is contained in:
parent
144681fc0f
commit
f1d16386b6
1 changed files with 5 additions and 6 deletions
|
@ -1,6 +1,6 @@
|
||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
*
|
*
|
||||||
* raylib [shaders] example - Blinn-Phong lighting
|
* raylib [shaders] example - Basic lighting: Blinn-Phong
|
||||||
*
|
*
|
||||||
* This example has been created using raylib 1.3 (www.raylib.com)
|
* This example has been created using raylib 1.3 (www.raylib.com)
|
||||||
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
* raylib is licensed under an unmodified zlib/libpng license (View raylib.h for details)
|
||||||
|
@ -22,8 +22,7 @@ int main()
|
||||||
const int screenHeight = 450;
|
const int screenHeight = 450;
|
||||||
|
|
||||||
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
SetConfigFlags(FLAG_MSAA_4X_HINT);
|
||||||
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - blinn-phong lighting");
|
InitWindow(screenWidth, screenHeight, "raylib [shaders] example - basic lighting");
|
||||||
SetTargetFPS(60);
|
|
||||||
|
|
||||||
// Camera initialization
|
// Camera initialization
|
||||||
Camera camera = {{ 8.0f, 8.0f, 8.0f }, { 0.0f, 3.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
Camera camera = {{ 8.0f, 8.0f, 8.0f }, { 0.0f, 3.0f, 0.0f }, { 0.0f, 1.0f, 0.0f }};
|
||||||
|
@ -72,6 +71,8 @@ int main()
|
||||||
SetCameraMode(CAMERA_FREE); // Set camera mode
|
SetCameraMode(CAMERA_FREE); // Set camera mode
|
||||||
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
SetCameraPosition(camera.position); // Set internal camera position to match our camera position
|
||||||
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
SetCameraTarget(camera.target); // Set internal camera target to match our camera target
|
||||||
|
|
||||||
|
SetTargetFPS(60);
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Main game loop
|
// Main game loop
|
||||||
|
@ -79,9 +80,7 @@ int main()
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
UpdateCamera(&camera); // Update camera position
|
||||||
// Update camera position
|
|
||||||
UpdateCamera(&camera);
|
|
||||||
|
|
||||||
// Glossiness input control
|
// Glossiness input control
|
||||||
if(IsKeyDown(KEY_UP)) matBlinn.glossiness += SHININESS_SPEED;
|
if(IsKeyDown(KEY_UP)) matBlinn.glossiness += SHININESS_SPEED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue