1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-06-06 13:17:46 +00:00

Add g_PbrParameterCommon buffer to the Dawntrail renderer

This commit is contained in:
Joshua Goins 2025-06-02 21:48:48 -04:00
parent 87e4188d9f
commit 4676653c84
3 changed files with 19 additions and 0 deletions

View file

@ -102,6 +102,7 @@ private:
Buffer g_DecalColor;
Buffer g_AmbientParam;
Buffer g_ShaderTypeParameter;
Buffer g_PbrParameterCommon;
Buffer m_planeVertexBuffer;

View file

@ -109,3 +109,8 @@ struct AmbientParameters {
struct ShaderTypeParameter {
glm::vec4 m[2044];
};
// Dawntrail
struct PbrParameterCommon {
glm::vec4 unk;
};

View file

@ -231,6 +231,17 @@ GameRenderer::GameRenderer(Device &device, GameData *data)
m_device.copyToBuffer(g_ShaderTypeParameter, &shaderTypeParameter, sizeof(ShaderTypeParameter));
}
// pbr common parameter
if (m_dawntrailMode) {
g_PbrParameterCommon = m_device.createBuffer(sizeof(PbrParameterCommon), VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT);
m_device.nameBuffer(g_PbrParameterCommon, "g_PbrParameterCommon");
PbrParameterCommon pbrParameterCommon{};
pbrParameterCommon.unk = {31.01465, 30.99805, 1.00, 0.00};
m_device.copyToBuffer(g_PbrParameterCommon, &pbrParameterCommon, sizeof(PbrParameterCommon));
}
VkSamplerCreateInfo samplerInfo = {};
samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO;
samplerInfo.magFilter = VK_FILTER_NEAREST;
@ -1399,6 +1410,8 @@ GameRenderer::createDescriptorFor(const DrawObject *object, const CachedPipeline
useUniformBuffer(g_AmbientParam);
} else if (strcmp(name, "g_ShaderTypeParameter") == 0) {
useUniformBuffer(g_ShaderTypeParameter);
} else if (strcmp(name, "g_PbrParameterCommon") == 0) {
useUniformBuffer(g_PbrParameterCommon);
} else {
qInfo() << "Unknown resource:" << name;
info->buffer = m_dummyBuffer.buffer;