Update the camera before sending it to the shader
This commit is contained in:
parent
c15f3214d5
commit
421fd7e6f5
1 changed files with 196 additions and 194 deletions
|
|
@ -111,9 +111,11 @@ int main(void)
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
float deltaTime = GetFrameTime();
|
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;
|
Vector3 cameraPos = camera.position;
|
||||||
SetShaderValue(shadowShader, shadowShader.locs[SHADER_LOC_VECTOR_VIEW], &cameraPos, SHADER_UNIFORM_VEC3);
|
SetShaderValue(shadowShader, shadowShader.locs[SHADER_LOC_VECTOR_VIEW], &cameraPos, SHADER_UNIFORM_VEC3);
|
||||||
UpdateCamera(&camera, CAMERA_ORBITAL);
|
|
||||||
|
|
||||||
frameCounter++;
|
frameCounter++;
|
||||||
frameCounter %= (anims[0].keyframeCount);
|
frameCounter %= (anims[0].keyframeCount);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue