Fix: 打开新模型时旧模型存在残留
parent
d968b585fb
commit
9ff0a3b45c
|
@ -108,6 +108,7 @@ void Renderer::Model::unloadModel()
|
|||
paintingLoaded.clear();
|
||||
texturesLoaded.clear();
|
||||
meshes.clear();
|
||||
paintingMeshes.clear();
|
||||
|
||||
minPos = glm::vec3(std::numeric_limits<float>::max());
|
||||
maxPos = glm::vec3(std::numeric_limits<float>::min());
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace Renderer
|
|||
}
|
||||
}
|
||||
|
||||
PageIDCallbackPass::PageIDCallbackPass(GladGLContext* gl, unsigned int& frameWidth, unsigned int& frameHeight, QOpenGLFramebufferObject*& fbo, GLuint* gBuffers, GLuint& gPageID, VirtualTextureManager& vtManager)
|
||||
PageIDFeedbackPass::PageIDFeedbackPass(GladGLContext* gl, unsigned int& frameWidth, unsigned int& frameHeight, QOpenGLFramebufferObject*& fbo, GLuint* gBuffers, GLuint& gPageID, VirtualTextureManager& vtManager)
|
||||
: RenderPass(gl)
|
||||
, pageIdDownsampleShader(":/Shaders/pageId_downsample.comp")
|
||||
, frameWidth(frameWidth)
|
||||
|
@ -112,7 +112,7 @@ namespace Renderer
|
|||
{
|
||||
}
|
||||
|
||||
void PageIDCallbackPass::dispatch()
|
||||
void PageIDFeedbackPass::dispatch()
|
||||
{
|
||||
if (fbo->bind())
|
||||
{
|
||||
|
|
|
@ -49,10 +49,10 @@ namespace Renderer
|
|||
QMatrix4x4& view;
|
||||
};
|
||||
|
||||
class PageIDCallbackPass : public RenderPass
|
||||
class PageIDFeedbackPass : public RenderPass
|
||||
{
|
||||
public:
|
||||
PageIDCallbackPass(GladGLContext* gl, unsigned int& frameWidth, unsigned int& frameHeight, QOpenGLFramebufferObject*& fbo,
|
||||
PageIDFeedbackPass(GladGLContext* gl, unsigned int& frameWidth, unsigned int& frameHeight, QOpenGLFramebufferObject*& fbo,
|
||||
GLuint* gBuffers, GLuint& gPageID, VirtualTextureManager& vtManager);
|
||||
void dispatch();
|
||||
private:
|
||||
|
|
|
@ -138,7 +138,7 @@ void RendererGLWidget::initializeGL()
|
|||
|
||||
shadowMapPass = std::make_unique<ShadowMapPass>(gl.get(), shadowFboHandle, shadowMapResolution, light, model);
|
||||
geometryPass = std::make_unique<GeometryPass>(gl.get(), frameWidth, frameHeight, fboPtr, model, projection, view);
|
||||
pageIDCallbackPass = std::make_unique<PageIDCallbackPass>(gl.get(), frameWidth, frameHeight, fboPtr, gbuffers, gPageID, *vtManager);
|
||||
pageIDFeedbackPass = std::make_unique<PageIDFeedbackPass>(gl.get(), frameWidth, frameHeight, fboPtr, gbuffers, gPageID, *vtManager);
|
||||
lightingPass = std::make_unique<LightingPass>(gl.get(), frameWidth, frameHeight, view, camera, light,
|
||||
gBaseColor, gNormal, gPosition, gMetallicRoughness, shadowGbuffer, irradianceMap, prefilterMap, brdfLUTTexture);
|
||||
skyboxPass = std::make_unique<SkyboxPass>(gl.get(), fboPtr, projection, view, skyCubemap);
|
||||
|
@ -210,7 +210,7 @@ void RendererGLWidget::paintGL()
|
|||
//vtManager->commitMutex.lock();
|
||||
shadowMapPass->dispatch();
|
||||
geometryPass->dispatch();
|
||||
pageIDCallbackPass->dispatch();
|
||||
pageIDFeedbackPass->dispatch();
|
||||
//gl->Finish();
|
||||
//vtManager->commitMutex.unlock();
|
||||
lightingPass->dispatch();
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace Renderer
|
|||
|
||||
std::unique_ptr<ShadowMapPass> shadowMapPass;
|
||||
std::unique_ptr<GeometryPass> geometryPass;
|
||||
std::unique_ptr<PageIDCallbackPass> pageIDCallbackPass;
|
||||
std::unique_ptr<PageIDFeedbackPass> pageIDFeedbackPass;
|
||||
std::unique_ptr<LightingPass> lightingPass;
|
||||
std::unique_ptr<SkyboxPass> skyboxPass;
|
||||
std::unique_ptr<ToneMappingPass> toneMappingPass;
|
||||
|
|
Loading…
Reference in New Issue