diff --git a/src/DungeonStompApp.cpp b/src/DungeonStompApp.cpp index 5d0f968..2603485 100644 --- a/src/DungeonStompApp.cpp +++ b/src/DungeonStompApp.cpp @@ -2443,15 +2443,12 @@ void DungeonStompApp::DrawDungeon(ID3D12GraphicsCommandList* cmdList, const std: int texture_alias_number = texture_list_buffer[i]; int texture_number = TexMap[texture_alias_number].texture; - int normal_map_texture = TexMap[texture_alias_number].normalmaptextureid; - if (texture_alias_number == 104) { TexMap[texture_alias_number].is_alpha_texture = 1; } - draw = true; if (isAlpha) { @@ -2471,8 +2468,6 @@ void DungeonStompApp::DrawDungeon(ID3D12GraphicsCommandList* cmdList, const std: } } - - if (normal_map_texture == -1 && normalMap) { draw = false; } @@ -2481,11 +2476,8 @@ void DungeonStompApp::DrawDungeon(ID3D12GraphicsCommandList* cmdList, const std: draw = false; } - - int oid = 0; - if (drawingSSAO || drawingShadowMap) { oid = ObjectsToDraw[currentObject].objectId; @@ -2512,11 +2504,20 @@ void DungeonStompApp::DrawDungeon(ID3D12GraphicsCommandList* cmdList, const std: } } - - if (ObjectsToDraw[currentObject].castshaddow == 0) { draw = false; } + + //Don't draw shadows facing away from shadow light + if (ObjectsToDraw[currentObject].objectId == 58 || ObjectsToDraw[currentObject].objectId == 57) { + if (ObjectsToDraw[currentObject].angle == 270.0f) { + draw = false; + } + if (ObjectsToDraw[currentObject].angle == 0.0f) { + draw = false; + } + } + } if (currentObject >= playerGunObjectStart && currentObject < playerObjectStart && drawingShadowMap) { diff --git a/src/ProcessModel.cpp b/src/ProcessModel.cpp index e60cd0c..08579cd 100644 --- a/src/ProcessModel.cpp +++ b/src/ProcessModel.cpp @@ -263,6 +263,9 @@ void ObjectToD3DVertList(int ob_type, float angle, int oblist_index) } + ObjectsToDraw[number_of_polys_per_frame].angle = angle; + + //The object casts a shadow if (oblist[oblist_index].castshadow == 0) { ObjectsToDraw[number_of_polys_per_frame].castshaddow = 0; diff --git a/src/world.hpp b/src/world.hpp index 069e807..5d7777e 100644 --- a/src/world.hpp +++ b/src/world.hpp @@ -384,6 +384,7 @@ typedef struct poly_sort int texture; int objectId = -1; int castshaddow = 1; + float angle = -1; } POLY_SORT;