RenderPass.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013-2016, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_GRAPHICS_RENDERPASS_H
#define SURGSIM_GRAPHICS_RENDERPASS_H
#include <memory>
#include "SurgSim/Framework/SceneElement.h"
#include "SurgSim/Graphics/Camera.h"
namespace SurgSim
{
namespace Framework
{
class Component;
}
namespace Graphics
{
class Group;
class Material;
class RenderTarget;
class ScreenSpaceQuadRepresentation;
class Texture;
class View;
class RenderPass : public SurgSim::Framework::SceneElement
{
public:
explicit RenderPass(const std::string& name);
~RenderPass();
bool doInitialize() override;
bool setRenderTarget(std::shared_ptr<RenderTarget> target);
std::shared_ptr<RenderTarget> getRenderTarget();
virtual void setRenderOrder(SurgSim::Graphics::Camera::RenderOrder order, int value);
std::shared_ptr<Camera> getCamera();
bool setMaterial(std::shared_ptr<SurgSim::Framework::Component> material);
std::shared_ptr<Material> getMaterial();
void showColorTarget(int x, int y, int width, int height);
void hideColorTarget();
void showDepthTarget(int x, int y, int width, int height);
void hideDepthTarget();
private:
std::shared_ptr<Camera> m_camera;
std::shared_ptr<Group> m_group;
std::shared_ptr<RenderTarget> m_renderTarget;
std::shared_ptr<Material> m_material;
int m_renderOrder;
std::shared_ptr<ScreenSpaceQuadRepresentation> m_debugColor;
std::shared_ptr<ScreenSpaceQuadRepresentation> m_debugDepth;
std::shared_ptr<ScreenSpaceQuadRepresentation> buildDebugQuad(
const std::string& name,
std::shared_ptr<Texture> texture);
};
}; // Graphics
}; // SurgSim
#endif
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
Camera.h
SurgSim::Graphics::RenderPass::m_camera
std::shared_ptr< Camera > m_camera
The camera used for the pass.
Definition: RenderPass.h:109
SurgSim::Graphics::RenderPass::m_renderTarget
std::shared_ptr< RenderTarget > m_renderTarget
The camera&#39;s rendertarget.
Definition: RenderPass.h:111
SurgSim::Graphics::RenderPass::m_group
std::shared_ptr< Group > m_group
The groupd used for the pass.
Definition: RenderPass.h:110
SurgSim::Graphics::RenderPass::m_renderOrder
int m_renderOrder
The renderorder that is being used for this pass.
Definition: RenderPass.h:114
SurgSim::Graphics::RenderPass::m_debugColor
std::shared_ptr< ScreenSpaceQuadRepresentation > m_debugColor
Definition: RenderPass.h:116
SurgSim::Graphics::RenderPass::m_debugDepth
std::shared_ptr< ScreenSpaceQuadRepresentation > m_debugDepth
Definition: RenderPass.h:117
SurgSim::Graphics::RenderPass::m_material
std::shared_ptr< Material > m_material
The material, attached to the camera.
Definition: RenderPass.h:112
SceneElement.h
SurgSim::Framework::SceneElement
SceneElement is the basic part of a scene, it is a container of components.
Definition: SceneElement.h:51
SurgSim::Graphics::Camera::RenderOrder
RenderOrder
Definition: Camera.h:55
SurgSim::Graphics::RenderPass
Encapsulation of all the components necessary needed to implement a full renderpass, this SceneElement contains a Camera and Group, it can also take a Material (for shaders and uniforms) and a RenderTarget for textures that are used as the output for the camera.
Definition: RenderPass.h:50