-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from ProtectedVariable/renderpass
Renderpass
- Loading branch information
Showing
32 changed files
with
463 additions
and
242 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 330 core | ||
|
||
out vec4 fragColor; | ||
|
||
in vec2 fUV; | ||
uniform sampler2D uTexture; | ||
|
||
void main() { | ||
fragColor = texture(uTexture, fUV); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#version 330 core | ||
layout (location = 0) in vec3 aPos; | ||
layout (location = 1) in vec2 aUV; | ||
|
||
out vec2 fUV; | ||
|
||
void main() { | ||
gl_Position = vec4(aPos, 1.0); | ||
fUV = aUV; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <Entity.h> | ||
|
||
#include "Framebuffer.h" | ||
#include "GraphicsFactory.h" | ||
#include "RenderCommand.h" | ||
#include "RenderPass.h" | ||
|
||
namespace ICE { | ||
class GeometryPass : public RenderPass { | ||
public: | ||
GeometryPass(const std::shared_ptr<RendererAPI>& api, const std::shared_ptr<GraphicsFactory>& factory, const FrameBufferFormat& format); | ||
void submit(std::vector<RenderCommand>* commands) { m_render_queue = commands; } | ||
void execute() override; | ||
std::shared_ptr<Framebuffer> getResult() const; | ||
void resize(int w, int h); | ||
|
||
private: | ||
std::shared_ptr<RendererAPI> m_api; | ||
std::shared_ptr<Framebuffer> m_framebuffer; | ||
std::vector<RenderCommand>* m_render_queue; | ||
}; | ||
} // namespace ICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include <vector> | ||
|
||
static std::vector<float> full_quad_v = { | ||
-1.0f, -1.0f, 0.0f, // TOP LEFT | ||
1.0, -1.0f, 0.0f, // TOP RIGHT | ||
-1.0f, 1.0, 0.0f, // BOTTOM LEFT | ||
1.0, 1.0, 0.0f, // BOTTOM RIGHT | ||
}; | ||
|
||
static std::vector<int> full_quad_idx = { | ||
0, 1, 2, 2, 1, 3 | ||
}; | ||
|
||
|
||
static std::vector<float> full_quad_tx = { | ||
0, 0, // TOP LEFT | ||
1, 0, // TOP RIGHT | ||
0, 1, // BOTTOM LEFT | ||
1, 1, // BOTTOM RIGHT | ||
1, 0, // TOP RIGHT | ||
0, 1 // BOTTOM LEFT | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
namespace ICE { | ||
class RenderPass { | ||
public: | ||
virtual ~RenderPass() = default; | ||
virtual void execute() = 0; | ||
}; | ||
} // namespace ICE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.