diff --git a/src/database/CSqliteDB.cpp b/src/database/CSqliteDB.cpp index 5a3c816a..36166c7a 100644 --- a/src/database/CSqliteDB.cpp +++ b/src/database/CSqliteDB.cpp @@ -61,9 +61,13 @@ const std::string getWmoAreaAreaNameSQL = R"===( const std::string getLightByIdSQL = R"===( select - l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd, l.LightParamsID_0, - IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID, IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID, - lp.Glow, IFNULL(ls.Flags, 0) as SkyboxFlags + l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd, + l.LightParamsID_0, l.LightParamsID_1, l.LightParamsID_2, l.LightParamsID_3, l.LightParamsID_4, + l.LightParamsID_5, l.LightParamsID_6, l.LightParamsID_7, + IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID, + IFNULL(ls.Flags, 0) as SkyboxFlags, + IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID, + lp.Glow from Light l left join LightParams lp on lp.ID = l.LightParamsID_0 left join LightSkybox ls on ls.ID = lp.LightSkyboxID @@ -72,15 +76,17 @@ const std::string getLightByIdSQL = R"===( const std::string getLightSQL = R"===( select - l.id as LightId, l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, l.GameFalloffStart, l.GameFalloffEnd, l.LightParamsID_0, - IFNULL(ls.SkyboxFileDataID, 0) as SkyboxFileDataID, IFNULL(lp.LightSkyboxID, 0) as LightSkyboxID, - lp.Glow, IFNULL(ls.Flags, 0) as SkyboxFlags, l.ContinentID, + l.id as LightId, l.GameCoords_0, l.GameCoords_1, l.GameCoords_2, + l.GameFalloffStart, l.GameFalloffEnd, + l.ContinentID, + + l.LightParamsID_0, l.LightParamsID_1, l.LightParamsID_2, l.LightParamsID_3, l.LightParamsID_4, + l.LightParamsID_5, l.LightParamsID_6, l.LightParamsID_7, + (abs(l.GameCoords_0 - ?1) * abs(l.GameCoords_0 - ?1) + abs(l.GameCoords_1 - ?2) * abs(l.GameCoords_1 - ?2) + abs(l.GameCoords_2 - ?3) * abs(l.GameCoords_2 - ?3)) as lightDistSQR from Light l - left join LightParams lp on lp.ID = l.LightParamsID_0 - left join LightSkybox ls on ls.ID = lp.LightSkyboxID where ((l.ContinentID = ?4) and ( @@ -336,7 +342,14 @@ void CSqliteDB::getLightById(int lightId, int time, LightResult &lightResult, fl ilr.pos[2] = getLightByIdStatement.getField("GameCoords_2").getDouble(); ilr.fallbackStart = getLightByIdStatement.getField("GameFalloffStart").getDouble(); ilr.fallbackEnd = getLightByIdStatement.getField("GameFalloffEnd").getDouble(); - ilr.paramId = getLightByIdStatement.getField("LightParamsID_0").getInt(); + ilr.paramId[0] = getLightByIdStatement.getField("LightParamsID_0").getInt(); + ilr.paramId[1] = getLightByIdStatement.getField("LightParamsID_1").getInt(); + ilr.paramId[2] = getLightByIdStatement.getField("LightParamsID_2").getInt(); + ilr.paramId[3] = getLightByIdStatement.getField("LightParamsID_3").getInt(); + ilr.paramId[4] = getLightByIdStatement.getField("LightParamsID_4").getInt(); + ilr.paramId[5] = getLightByIdStatement.getField("LightParamsID_5").getInt(); + ilr.paramId[6] = getLightByIdStatement.getField("LightParamsID_6").getInt(); + ilr.paramId[7] = getLightByIdStatement.getField("LightParamsID_7").getInt(); ilr.skyBoxFileId = getLightByIdStatement.getField("SkyboxFileDataID").getInt(); ilr.lightSkyboxId = getLightByIdStatement.getField("LightSkyboxID").getInt(); ilr.glow = getLightByIdStatement.getField("Glow").getDouble(); @@ -366,7 +379,14 @@ void CSqliteDB::getEnvInfo(int mapId, float x, float y, float z, int ptime, std: ilr.pos[2] = getLightStatement.getField("GameCoords_2").getDouble(); ilr.fallbackStart = getLightStatement.getField("GameFalloffStart").getDouble(); ilr.fallbackEnd = getLightStatement.getField("GameFalloffEnd").getDouble(); - ilr.paramId = getLightStatement.getField("LightParamsID_0").getInt(); + ilr.paramId[0] = getLightStatement.getField("LightParamsID_0").getInt(); + ilr.paramId[1] = getLightStatement.getField("LightParamsID_1").getInt(); + ilr.paramId[2] = getLightStatement.getField("LightParamsID_2").getInt(); + ilr.paramId[3] = getLightStatement.getField("LightParamsID_3").getInt(); + ilr.paramId[4] = getLightStatement.getField("LightParamsID_4").getInt(); + ilr.paramId[5] = getLightStatement.getField("LightParamsID_5").getInt(); + ilr.paramId[6] = getLightStatement.getField("LightParamsID_6").getInt(); + ilr.paramId[7] = getLightStatement.getField("LightParamsID_7").getInt(); ilr.skyBoxFileId = getLightStatement.getField("SkyboxFileDataID").getInt(); ilr.lightSkyboxId = getLightStatement.getField("LightSkyboxID").getInt(); ilr.glow = getLightStatement.getField("Glow").getDouble(); diff --git a/src/database/CSqliteDB.h b/src/database/CSqliteDB.h index b3c2892a..83638711 100644 --- a/src/database/CSqliteDB.h +++ b/src/database/CSqliteDB.h @@ -135,7 +135,7 @@ class CSqliteDB : public IClientDatabase { float fallbackEnd; float lightDistSQR = 0; float blendAlpha = 0; - int paramId; + int paramId[8]; int skyBoxFileId; int lightSkyboxId; float glow; diff --git a/wowViewerLib/shaders/src/spirv/dumpShaderFields.h b/wowViewerLib/shaders/src/spirv/dumpShaderFields.h index d156ad69..b87600f5 100644 --- a/wowViewerLib/shaders/src/spirv/dumpShaderFields.h +++ b/wowViewerLib/shaders/src/spirv/dumpShaderFields.h @@ -209,7 +209,7 @@ void dumpShaderUniformOffsets(const std::string &basePath, const std::vector uboBindings; std::array uboBindingAmountsPerSet; - std::vector ssboBindingData; + std::vector m_ssboBindings; std::vector imageBindings; std::array imageBindingAmountsPerSet; diff --git a/wowViewerLib/src/gapi/vulkan/descriptorSets/GDescriptorSetLayout.cpp b/wowViewerLib/src/gapi/vulkan/descriptorSets/GDescriptorSetLayout.cpp index 599a8f79..96c9143c 100644 --- a/wowViewerLib/src/gapi/vulkan/descriptorSets/GDescriptorSetLayout.cpp +++ b/wowViewerLib/src/gapi/vulkan/descriptorSets/GDescriptorSetLayout.cpp @@ -202,8 +202,8 @@ void GDescriptorSetLayout::fillUbo(int setIndex, const DescTypeOverride &typeOve void GDescriptorSetLayout::fillSSBO(int setIndex, const DescTypeOverride &typeOverrides, std::unordered_map &shaderLayoutBindings, const shaderMetaData *p_metaData, const VkShaderStageFlagBits &vkStageFlag) { - for (int i = 0; i < p_metaData->ssboBindingData.size(); i++) { - auto &ssboBinding = p_metaData->ssboBindingData[i]; + for (int i = 0; i < p_metaData->ssboBindings.size(); i++) { + auto &ssboBinding = p_metaData->ssboBindings[i]; if (ssboBinding.set != setIndex) continue; diff --git a/wowViewerLib/src/gapi/vulkan/shaders/GShaderPermutationVLK.cpp b/wowViewerLib/src/gapi/vulkan/shaders/GShaderPermutationVLK.cpp index 32e51224..5cf2511a 100644 --- a/wowViewerLib/src/gapi/vulkan/shaders/GShaderPermutationVLK.cpp +++ b/wowViewerLib/src/gapi/vulkan/shaders/GShaderPermutationVLK.cpp @@ -132,8 +132,8 @@ void GShaderPermutationVLK::createShaderLayout() { } } - for (int i = 0; i < shaderMeta->ssboBindingData.size(); i++) { - auto &ssboBinding = shaderMeta->ssboBindingData[i]; + for (int i = 0; i < shaderMeta->ssboBindings.size(); i++) { + auto &ssboBinding = shaderMeta->ssboBindings[i]; auto &setLayout = combinedShaderLayout.setLayouts[ssboBinding.set]; diff --git a/wowViewerLib/src/include/database/dbStructs.h b/wowViewerLib/src/include/database/dbStructs.h index 024ba00d..d64c9989 100644 --- a/wowViewerLib/src/include/database/dbStructs.h +++ b/wowViewerLib/src/include/database/dbStructs.h @@ -30,6 +30,7 @@ struct LightResult { float closeOceanColor[3]; float farOceanColor[3]; + //Sky std::array SkyTopColor; float SkyMiddleColor[3]; float SkyBand1Color[3]; @@ -64,7 +65,6 @@ struct LightResult { std::array HeightEndFogColor; float FogStartOffset = 0; - std::string skyBoxName; int skyBoxFdid; int skyBoxFlags;