Commit c7b11b5e authored by Jonathan Kunstwald's avatar Jonathan Kunstwald
Browse files

Fix compilation of geometry grass sample with latest glow

parent 5e904faa
......@@ -306,7 +306,11 @@ void GeometryGrassSample::init()
mGrassUBO = UniformBuffer::create();
mGrassUBO->bind().setData(mGrassUBOData);
mTrampleSSBOData.mowerPos = glm::vec2(0);
mTrampleSSBOData.mowerPosX = 0;
mTrampleSSBOData.mowerPosY = 0;
// mTrampleSSBOData.mowerPos = glm::vec2(0);
static auto constexpr mowerRange = .75f;
mTrampleSSBOData.mowerRangeSquared = mowerRange * mowerRange;
mTrampleSSBO = ShaderStorageBuffer::create();
......@@ -381,8 +385,9 @@ void GeometryGrassSample::onRenderOpaquePass(glow::pipeline::RenderContext const
{
// UBO + SSBO Update
{
mTrampleSSBOData.mowerPos = mMowerPosition;
mTrampleSSBO->bind().setData(mTrampleSSBOData);
mTrampleSSBOData.mowerPosX = mMowerPosition.x;
mTrampleSSBOData.mowerPosY = mMowerPosition.y;
mTrampleSSBO->bind().setData(mTrampleSSBOData, GL_STREAM_DRAW);
applyConfigToUBO();
mGrassUBOData.cameraUp = getCamera()->handle.getTransform().getUpVector();
......@@ -390,7 +395,7 @@ void GeometryGrassSample::onRenderOpaquePass(glow::pipeline::RenderContext const
mGrassUBOData.cleanVp = info.camData.cleanVp;
mGrassUBOData.prevCleanVp = info.camData.prevCleanVp;
mGrassUBOData.runtime = getCurrentTime();
mGrassUBO->bind().setData(mGrassUBOData);
mGrassUBO->bind().setData(mGrassUBOData, GL_STREAM_DRAW);
}
// Trampling and mowing
......
......@@ -39,15 +39,17 @@ struct GrassUBOData
struct Trampler
{
glow::std140vec2 pos;
glow::std140vec2 velocity;
glm::vec2 pos;
glm::vec2 velocity;
};
struct TrampleSSBOData
{
glow::std140vec2 mowerPos;
glow::std140float mowerRangeSquared = 1.f;
std::vector<Trampler> tramplers;
float mowerPosX;
float mowerPosY;
// glm::vec2 mowerPos;
float mowerRangeSquared = 1.f;
// std::vector<Trampler> tramplers;
};
}
......
......@@ -15,7 +15,7 @@ layout(std430) buffer sTrampleInfo
vec2 mowerPosition;
float mowerRange2;
Trampler tramplers[];
//Trampler tramplers[];
} ssboTrampleInfo;
void main()
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment