Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Deamon87 committed Jul 3, 2024
1 parent 5fcfea9 commit cb34cfb
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 20 deletions.
7 changes: 4 additions & 3 deletions src/ui/renderer/uiScene/vulkan/FrontendUIRenderForwardVLK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ void FrontendUIRenderForwardVLK::createBuffers() {
vboBuffer = m_device->createVertexBuffer("UI_Vbo_Buffer", 1024*1024);
uboBuffer = m_device->createUniformBuffer("UI_UBO", sizeof(ImgUI::modelWideBlockVS)*IDevice::MAX_FRAMES_IN_FLIGHT);

m_imguiUbo = std::make_shared<CBufferChunkVLK<ImgUI::modelWideBlockVS>>(uboBuffer);
m_imguiUboVLK = std::make_shared<CBufferChunkVLK<ImgUI::modelWideBlockVS>>(uboBuffer);
m_imguiUbo = m_imguiUboVLK;
}

HGVertexBuffer FrontendUIRenderForwardVLK::createVertexBuffer(int sizeInBytes) {
Expand Down Expand Up @@ -58,7 +59,7 @@ std::shared_ptr<IUIMaterial> FrontendUIRenderForwardVLK::createUIMaterial(const
}
}

auto &l_imguiUbo = m_imguiUbo;
auto &l_imguiUbo = m_imguiUboVLK;
auto material = MaterialBuilderVLK::fromShader(m_device, {"imguiShader", !opaque?"imguiShader":"imguiShader_opaque"}, {"forwardRendering","forwardRendering"}, {})
.createPipeline(m_emptyImguiVAO, m_lastRenderPass, s_imguiPipelineTemplate)
.createDescriptorSet(0, [&l_imguiUbo](std::shared_ptr<GDescriptorSet> &ds) {
Expand Down Expand Up @@ -92,7 +93,7 @@ std::shared_ptr<IUIMaterial> FrontendUIRenderForwardVLK::createUIMaterialDepth(c
}
}

auto &l_imguiUbo = m_imguiUbo;
auto &l_imguiUbo = m_imguiUboVLK;
auto material = MaterialBuilderVLK::fromShader(m_device, {"imguiShader", "imguiShaderDepth"}, {"forwardRendering", "forwardRendering"}, {})
.createPipeline(m_emptyImguiVAO, m_lastRenderPass, s_imguiPipelineTemplate)
.createDescriptorSet(0, [&l_imguiUbo](std::shared_ptr<GDescriptorSet> &ds) {
Expand Down
4 changes: 3 additions & 1 deletion src/ui/renderer/uiScene/vulkan/FrontendUIRenderForwardVLK.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#ifndef AWEBWOWVIEWERCPP_FRONTENDUIRENDERFORWARDVLK_H
#define AWEBWOWVIEWERCPP_FRONTENDUIRENDERFORWARDVLK_H


#include <queue>
#include <random>
#include "../FrontendUIRenderer.h"
Expand All @@ -16,6 +15,7 @@
#include "../../../../../wowViewerLib/src/renderer/vulkan/IRenderFunctionVLK.h"
#include "../../../../../wowViewerLib/src/gapi/vulkan/meshes/GMeshVLK.h"
#include "../../../../../wowViewerLib/src/engine/objects/scenes/EntityActorsFactory.h"
#include "../../../../../wowViewerLib/src/gapi/vulkan/buffers/CBufferChunkVLK.h"

class FrontendUIRenderForwardVLK : public FrontendUIRenderer {
public:
Expand Down Expand Up @@ -54,6 +54,8 @@ class FrontendUIRenderForwardVLK : public FrontendUIRenderer {
std::shared_ptr<GRenderPassVLK> m_lastRenderPass;
std::shared_ptr<std::vector<HGMesh>> m_previousMeshes = nullptr;

std::shared_ptr<CBufferChunkVLK<ImgUI::modelWideBlockVS>> m_imguiUboVLK = nullptr;

HGVertexBufferBindings m_emptyImguiVAO = nullptr;
};

Expand Down
33 changes: 21 additions & 12 deletions wowViewerLib/src/engine/objects/scenes/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -997,12 +997,17 @@ void Map::getLightResultsFromDB(mathfu::vec3 &cameraVec3, const Config *config,
}
}

uint8_t currentLightParamId = 0;
uint8_t currentLightParamIdIndex = 0;

int selectedLightParam = 0;
int selectedLightId = 0;

if (zoneLightFound) {
selectedLightId = LightId;
m_api->databaseHandler->getLightById(LightId, config->currentTime, zoneLightResult);
if (stateForConditions != nullptr) {
stateForConditions->currentZoneLights.push_back(zoneLightResult.lightParamId[currentLightParamId]);
selectedLightParam = zoneLightResult.lightParamId[currentLightParamIdIndex];
stateForConditions->currentZoneLights.push_back(zoneLightResult.lightParamId[currentLightParamIdIndex]);
}
}

Expand All @@ -1017,27 +1022,31 @@ void Map::getLightResultsFromDB(mathfu::vec3 &cameraVec3, const Config *config,
return a.blendAlpha > b.blendAlpha;
});

int selectedLightParam = 0;

for (auto it = lightResults.begin(); it != lightResults.end(); it++) {
if (feq(it->pos[0], 0.0) && feq(it->pos[1], 0.0) && feq(it->pos[2], 0.0)) {
//This is default record. If zoneLight was selected -> skip it.
if (!zoneLightFound) {

selectedLightParam = it->lightParamId[currentLightParamIdIndex];
selectedLightId = it->id;
}
} else {
selectedLightParam = it->lightParamId[currentLightParamIdIndex];
selectedLightId = it->id;
break;
}
selectedLightParam = it->lightParamId[currentLightParamId];
}

config->currentTime,


if (stateForConditions != nullptr) {
for (auto &_light : lightResults) {
stateForConditions->currentZoneLights.push_back(_light.lightParamId[currentLightParamId]);
stateForConditions->currentLightIds.push_back(_light.id);
}
stateForConditions->currentZoneLights.push_back(selectedLightParam);
stateForConditions->currentLightIds.push_back(selectedLightId);
}

LightParamData lightParamData;
if (m_api->databaseHandler->getLightParamData(selectedLightParam, config->currentTime, lightParamData)) {
//Blend two times using certain rules

}
}
void Map::getPotentialEntities(const MathHelper::FrustumCullingData &frustumData,
const mathfu::vec4 &cameraPos,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ void GDescriptorSetLayout::fillUbo(int setIndex, const DescTypeOverride &typeOve
void GDescriptorSetLayout::fillSSBO(int setIndex, const DescTypeOverride &typeOverrides,
std::unordered_map<int, VkDescriptorSetLayoutBinding> &shaderLayoutBindings,
const shaderMetaData *p_metaData, const VkShaderStageFlagBits &vkStageFlag) {
for (int i = 0; i < p_metaData->ssboBindings.size(); i++) {
auto &ssboBinding = p_metaData->ssboBindings[i];
for (int i = 0; i < p_metaData->m_ssboBindings.size(); i++) {
auto &ssboBinding = p_metaData->m_ssboBindings[i];

if (ssboBinding.set != setIndex) continue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ void GShaderPermutationVLK::createShaderLayout() {
}
}

for (int i = 0; i < shaderMeta->ssboBindings.size(); i++) {
auto &ssboBinding = shaderMeta->ssboBindings[i];
for (int i = 0; i < shaderMeta->m_ssboBindings.size(); i++) {
auto &ssboBinding = shaderMeta->m_ssboBindings[i];

auto &setLayout = combinedShaderLayout.setLayouts[ssboBinding.set];

Expand Down
2 changes: 2 additions & 0 deletions wowViewerLib/src/include/database/dbStructs.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ struct LightParamData {
float oceanDeepAlpha;
int lightParamFlags = 0;



std::array<LightTimedData, 2> lightTimedData;
};

Expand Down

0 comments on commit cb34cfb

Please sign in to comment.