-
-
Save vasumahesh1/08fa44f16daba245574794e18ebd47dd to your computer and use it in GitHub Desktop.
Design Ideas
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
auto ModuleLog = Log::Create("ModuleLog", 50); | |
#define LOG_INFO(...) ModuleLog.info(...) | |
LOG_INFO(ModuleLog, "Testing %s %d", "vasu", 1); |
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
Render Pass Logic: | |
RenderPassBuffers { | |
{GB_TARGET_1, RGBA32}, | |
{GB_TARGET_2, RGBA32}, | |
{GB_TARGET_3, RGBA32}, | |
{POST_PASS_1, RGBA32}, | |
{POST_PASS_2, RGBA32}, | |
{POST_PASS_3, RGBA32}, | |
{POST_PASS_4, RGBA8} | |
} | |
createInfo.renderPasses = {GBUFFER_RENDER_PASS} | |
pool = CreateDrawablePool() | |
RenderPass { | |
GBUFFER_RENDER_PASS | |
Inputs {} | |
Outputs {GB_TARGET_1, GB_TARGET_2, GB_TARGET_3} | |
} | |
RenderPass { | |
LIGHTING_RENDER_PASS | |
Inputs {GB_TARGET_1} | |
Outputs {POST_PASS_1} | |
} | |
RenderPass { | |
BLOOM_RENDER_PASS | |
Inputs {GB_TARGET_1} | |
Outputs {POST_PASS_2} | |
} | |
RenderPass { | |
COMPOSITE_PASS | |
Inputs {POST_PASS_1, POST_PASS_2} | |
Outputs {POST_PASS_3} | |
} | |
RenderPass { | |
TONE_MAP_RENDER_PASS | |
Inputs {POST_PASS_3} | |
Outputs {POST_PASS_4} | |
} | |
Sequence {GBUFFER_RENDER_PASS, LIGHTING_RENDER_PASS, BLOOM_RENDER_PASS, COMPOSITE_PASS, TONE_MAP_RENDER_PASS} |
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
class Drawable { | |
Containers::Vector<BufferInfo> m_offset; | |
U32 m_vertexCount; | |
U32 m_indexCount; | |
void AddShader(const Shader& module); // static_cast? reinterpret_cast? | |
void AddVertexData(Vector<U8> buffer, Slot slot); | |
void SetIndexData(Vector<U8> buffer); | |
void SetDrawMode(DrawType drawType); | |
} | |
DrawablePool { | |
Buffer m_buffer; | |
void AddBufferBinding(Slot slot, Vector<StrideInfo> strides) | |
} | |
slotVertex = Slot[slot=0, Usage::Vertex] | |
slotInstance = Slot[slot=1, Usage::Instance] | |
pool = CreateDrawablePool() | |
pool.AddBufferBinding(slotVertex, StrideInfo[pos, color, normal]); | |
pool.AddBufferBinding(slotInstance, StrideInfo[pos]); | |
drawable = pool.AllocateDrawable(); | |
drawable.AddVertexData(..., slotVertex) | |
drawable.AddInstanceData(..., slotInstance) | |
drawable.AddIndexData(...) | |
drawable.SetDrawMode(DrawType::Indexed); | |
drawable.Submit(); | |
... | |
drawable.Render(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment