diff --git a/resources/config2/interactive_objects_dorm.json b/resources/config2/interactive_objects_dorm.json index e3d7521..a84fa41 100644 --- a/resources/config2/interactive_objects_dorm.json +++ b/resources/config2/interactive_objects_dorm.json @@ -406,6 +406,7 @@ "name": "Room_Cover_Bath_W_N_2_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_North_West_1_Bath_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -419,6 +420,7 @@ "name": "Room_Cover_LivingRoom_W_N_2_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_North_West_1_RoomB_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -432,6 +434,7 @@ "name": "Room_Cover_LivingRoom_W_S_2_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_South_West_1_RoomB_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -445,6 +448,7 @@ "name": "Room_Cover_Main_Hall_And_Corridors_002", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_Main_Hall_Corridor_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -458,6 +462,7 @@ "name": "Room_Cover_Others_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_All_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -471,6 +476,7 @@ "name": "Room_Cover_Utility_W_N_3_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_North_West_2_Utility_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -484,6 +490,7 @@ "name": "Room_Cover_Utility_W_S_3_001", "texturePath": "resources/black.png", "meshPath": "resources/w/dorm2/Room_Cover_South_West_2_Utility_001.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, diff --git a/resources/config2/interactive_objects_uni_interior.json b/resources/config2/interactive_objects_uni_interior.json index f79417b..45d0332 100644 --- a/resources/config2/interactive_objects_uni_interior.json +++ b/resources/config2/interactive_objects_uni_interior.json @@ -307,6 +307,7 @@ "name": "Room_Cover_Corridor_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_Corridor_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -323,6 +324,7 @@ "name": "Room_Cover_Main_Hall_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_Main_Hall_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -339,6 +341,7 @@ "name": "Room_Cover_North_1_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_North_1_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -355,6 +358,7 @@ "name": "Room_Cover_South_1_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_South_1_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -371,6 +375,7 @@ "name": "Room_Cover_North_2_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_North_2_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -387,6 +392,7 @@ "name": "Room_Cover_South_2_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_South_2_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -403,6 +409,7 @@ "name": "Room_Cover_North_3_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_North_3_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, @@ -419,6 +426,7 @@ "name": "Room_Cover_South_3_001", "texturePath": "resources/black.png", "meshPath": "resources/w/interior/Room_Cover_South_3_002.txt", + "castShadowNight" : false, "rotationX": 0.0, "rotationY": 0.0, "rotationZ": 0.0, diff --git a/resources/shaders/fog_shadow_desktop.fragment b/resources/shaders/fog_shadow_desktop.fragment index 068c5a1..091d278 100644 --- a/resources/shaders/fog_shadow_desktop.fragment +++ b/resources/shaders/fog_shadow_desktop.fragment @@ -53,8 +53,8 @@ void main() if (color.a < 0.1) discard; - float ambient = 0.4; - float diffuseStrength = 0.6; + float ambient = 0.75; + float diffuseStrength = 0.25; // Compute diffuse term; if normals are missing (zero-length) treat as fully lit float diffuse = 1.0; diff --git a/resources/shaders/fog_shadow_web.fragment b/resources/shaders/fog_shadow_web.fragment index f862383..5077b47 100644 --- a/resources/shaders/fog_shadow_web.fragment +++ b/resources/shaders/fog_shadow_web.fragment @@ -53,8 +53,8 @@ void main() if (color.a < 0.1) discard; - float ambient = 0.4; - float diffuseStrength = 0.6; + float ambient = 0.75; + float diffuseStrength = 0.25; float diffuse = 1.0; vec3 n = fragNormal; diff --git a/src/Location.cpp b/src/Location.cpp index fd94ecf..a8bf274 100644 --- a/src/Location.cpp +++ b/src/Location.cpp @@ -713,7 +713,7 @@ namespace ZL } for (auto& intObj : interactiveObjects) { - if (intObj.isActive && intObj.loadedObject.texture) { + if (intObj.castShadow && intObj.loadedObject.texture) { renderer.PushMatrix(); renderer.TranslateMatrix(intObj.position); renderer.DrawVertexRenderStruct(intObj.loadedObject.mesh); @@ -957,7 +957,7 @@ namespace ZL renderer.DrawVertexRenderStruct(gameObj.mesh); } for (auto& intObj : interactiveObjects) { - if (intObj.isActive && intObj.loadedObject.texture) { + if (intObj.castShadowNight && intObj.loadedObject.texture) { renderer.PushMatrix(); renderer.TranslateMatrix(intObj.position); renderer.DrawVertexRenderStruct(intObj.loadedObject.mesh); diff --git a/src/items/GameObjectLoader.cpp b/src/items/GameObjectLoader.cpp index b4c6d2e..a1c0977 100644 --- a/src/items/GameObjectLoader.cpp +++ b/src/items/GameObjectLoader.cpp @@ -94,6 +94,9 @@ namespace ZL { data.base = parseGameObjectData(item); data.interactionRadius = item.value("interactionRadius", 2.0f); data.approachRadius = item.value("approachRadius", data.interactionRadius); + data.castShadow = item.value("castShadow", true); + data.castShadowNight = item.value("castShadowNight", true); + data.isActive = item.value("isActive", true); data.activateFunctionName = item.value("activateFunction", ""); data.pivotX = item.value("pivotX", 0.0f); data.pivotY = item.value("pivotY", 0.0f); @@ -196,6 +199,9 @@ namespace ZL { intObj.loadedObject = buildLoadedObject(data.base, renderer, zipPath); intObj.interactionRadius = data.interactionRadius; intObj.approachRadius = data.approachRadius; + intObj.castShadow = data.castShadow; + intObj.castShadowNight = data.castShadowNight; + intObj.isActive = data.isActive; intObj.activateFunctionName = data.activateFunctionName; intObj.pivot = Eigen::Vector3f(data.pivotX, data.pivotY, data.pivotZ); intObj.boundsMin = Eigen::Vector3f(data.boundsMinX, data.boundsMinY, data.boundsMinZ); diff --git a/src/items/GameObjectLoader.h b/src/items/GameObjectLoader.h index 4cb0819..88503cb 100644 --- a/src/items/GameObjectLoader.h +++ b/src/items/GameObjectLoader.h @@ -38,6 +38,9 @@ namespace ZL { float boundsMaxX = 0.0f, boundsMaxY = 0.0f, boundsMaxZ = 0.0f; bool hasInteractionPosition = false; float interactionPositionX = 0.0f, interactionPositionY = 0.0f, interactionPositionZ = 0.0f; + bool castShadow = true; + bool castShadowNight = true; + bool isActive = true; }; struct NpcData { diff --git a/src/items/InteractiveObject.h b/src/items/InteractiveObject.h index 5feb978..1e5689b 100644 --- a/src/items/InteractiveObject.h +++ b/src/items/InteractiveObject.h @@ -42,6 +42,8 @@ namespace ZL { bool hasInteractionPosition = false; bool isActive = true; bool isAnimating = false; // true while a timed animation is running + bool castShadow = true; // included in day shadow depth pass regardless of isActive + bool castShadowNight = true; // included in night shadow depth pass regardless of isActive std::string activateFunctionName; struct AnimTask {