Fixed UI not rendering (partially)
This commit is contained in:
@ -5,6 +5,7 @@
|
||||
|
||||
#include "RenderPipeline.hpp"
|
||||
#include "game/DawnGame.hpp"
|
||||
#include "scene/components/scene/SubSceneController.hpp"
|
||||
|
||||
#if DAWN_DEBUG_BUILD
|
||||
#include "scene/debug/SceneDebugLine.hpp"
|
||||
@ -174,7 +175,14 @@ void RenderPipeline::renderSceneCamera(Scene *scene, Camera *camera) {
|
||||
shaderBufferData.view = camera->transform->getWorldTransform();
|
||||
this->shaderBuffer.buffer(&shaderBufferData);
|
||||
|
||||
this->camera = camera;
|
||||
// Prepare a render context. This is just a nice way of letting renderables
|
||||
// know a bit about what is happening, they can choose to use this data to
|
||||
// render themselves differently.
|
||||
struct IRenderableContext context = {
|
||||
scene,
|
||||
camera,
|
||||
this
|
||||
};
|
||||
|
||||
// Get the list of things to render first.
|
||||
std::vector<struct ShaderPassItem> shaderPassItems;
|
||||
@ -183,8 +191,8 @@ void RenderPipeline::renderSceneCamera(Scene *scene, Camera *camera) {
|
||||
auto renderables = scene->findComponents<IRenderable>();
|
||||
auto itRenderables = renderables.begin();
|
||||
while(itRenderables != renderables.end()) {
|
||||
vectorAppend(&shaderPassItems, (*itRenderables)->getRenderPasses());
|
||||
++itRenderables;
|
||||
vectorAppend(&shaderPassItems, (*itRenderables)->getRenderPasses(context));
|
||||
++itRenderables;
|
||||
}
|
||||
|
||||
// Debug Lines
|
||||
|
@ -4,13 +4,11 @@
|
||||
// https://opensource.org/licenses/MIT
|
||||
|
||||
#pragma once
|
||||
#include "dawnlibs.hpp"
|
||||
#include "scene/components/display/Material.hpp"
|
||||
#include "scene/components/display/Camera.hpp"
|
||||
#include "scene/components/scene/SubSceneController.hpp"
|
||||
#include "scene/components/ui/UIComponent.hpp"
|
||||
#include "display/_RenderManager.hpp"
|
||||
#include "display/shader/ShaderPass.hpp"
|
||||
#include "scene/components/display/IRenderable.hpp"
|
||||
#include "display/shader/buffers/RenderPipelineShaderBuffer.hpp"
|
||||
#include "scene/components/display/Camera.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class RenderManager;
|
||||
@ -21,9 +19,6 @@ namespace Dawn {
|
||||
|
||||
public:
|
||||
RenderManager *renderManager;
|
||||
|
||||
// Temporary hack
|
||||
Camera *camera = nullptr;
|
||||
RenderPipelineShaderBuffer shaderBuffer;
|
||||
|
||||
/**
|
||||
|
@ -6,7 +6,6 @@
|
||||
#pragma once
|
||||
#include "display/shader/Shader.hpp"
|
||||
#include "display/mesh/Mesh.hpp"
|
||||
#include "display/shader/ShaderParameterBuffer.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
struct ShaderPassItem {
|
||||
|
Reference in New Issue
Block a user