3 Commits

Author SHA1 Message Date
Ray
079cc2df09 Update shaders_shadowmap_rendering.c 2026-08-08 17:03:55 +02:00
388806f24d [examples] shaders shadowmap rendering camera fix (#6041)
* Update the camera before sending it to the shader

* tabs to spaces (oops)
2026-08-08 16:58:39 +02:00
b0005129c7 fix typo in fix_win32_compatibility.h (#6043)
* fix typo in fix_win32_compatibility.h

* fix another typo in fix_win32_compatibility.h

* fix yet another typo in fix_win32_compatibility.h
2026-08-08 16:57:40 +02:00
2 changed files with 9 additions and 6 deletions

View File

@ -111,9 +111,11 @@ int main(void)
//----------------------------------------------------------------------------------
float deltaTime = GetFrameTime();
UpdateCamera(&camera, CAMERA_ORBITAL);
// send the updated camera position to the shader so that it can calculate the correct lighting for the scene
Vector3 cameraPos = camera.position;
SetShaderValue(shadowShader, shadowShader.locs[SHADER_LOC_VECTOR_VIEW], &cameraPos, SHADER_UNIFORM_VEC3);
UpdateCamera(&camera, CAMERA_ORBITAL);
frameCounter++;
frameCounter %= (anims[0].keyframeCount);
@ -160,6 +162,7 @@ int main(void)
EndMode3D();
EndTextureMode();
lightViewProj = MatrixMultiply(lightView, lightProj);
// PASS 02: Draw the scene into main framebuffer, using the generated shadowmap

View File

@ -2,7 +2,7 @@
*
* fix_win32_compatibility.h Utility to help include windows.h with raylib projects
*
* Useage: #include "fix_win32_compatibility.h" any library that uses windows.h
* Usage: #include "fix_win32_compatibility.h" any library that uses windows.h
* order is critical, this must be done before raylib
*
* LICENSE: MIT
@ -32,7 +32,7 @@
#pragma once
// move the windows functions to new names
// note that you can't call these functions or structures from your code, but you should not neeed to
// note that you can't call these functions or structures from your code, but you should not need to
#define CloseWindow CloseWindowWin32
#define Rectangle RectangleWin32
#define ShowCursor ShowCursorWin32
@ -47,7 +47,7 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
// remove all our redfintions so that raylib can define them properly
// remove all our redefinitions so that raylib can define them properly
#undef CloseWindow
#undef Rectangle
#undef ShowCursor