mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-09 20:08:57 +03:00
Added render target to gbuffer
This commit is contained in:
@@ -40,6 +40,7 @@ void main()
|
||||
layout(location = 0) out vec4 gAlbedo;
|
||||
layout(location = 1) out vec4 gNormal;
|
||||
layout(location = 2) out vec4 gMaterial;
|
||||
layout(location = 3) out int gEntityID;
|
||||
|
||||
in vec3 FragPos;
|
||||
in vec2 UV;
|
||||
@@ -102,4 +103,6 @@ void main()
|
||||
gMaterial.r = finalMetalness;
|
||||
gMaterial.g = finalAO;
|
||||
gMaterial.b = finalRoughness;
|
||||
|
||||
gEntityID = int(gAlbedo.r * 255.0);
|
||||
}
|
||||
@@ -13,7 +13,7 @@ namespace Nuake {
|
||||
mGBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB), GL_COLOR_ATTACHMENT0);
|
||||
mGBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB), GL_COLOR_ATTACHMENT1);
|
||||
mGBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB), GL_COLOR_ATTACHMENT2);
|
||||
mGBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB), GL_COLOR_ATTACHMENT3);
|
||||
mGBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RED_INTEGER, GL_R32I, GL_INT), GL_COLOR_ATTACHMENT3);
|
||||
|
||||
mShadingBuffer = CreateScope<FrameBuffer>(true, defaultResolution);
|
||||
mShadingBuffer->SetTexture(CreateRef<Texture>(defaultResolution, GL_RGB, GL_RGB16F, GL_FLOAT));
|
||||
|
||||
@@ -18,6 +18,12 @@ namespace Nuake {
|
||||
void RenderScene(Scene& scene, FrameBuffer& framebuffer);
|
||||
|
||||
Scope<SSR> mSSR;
|
||||
|
||||
FrameBuffer& GetGBuffer() const
|
||||
{
|
||||
return *mGBuffer;
|
||||
}
|
||||
|
||||
private:
|
||||
Matrix4 mProjection, mView;
|
||||
Vector3 mCamPos;
|
||||
|
||||
Reference in New Issue
Block a user