Commit 02e09673 authored by Dario Seyb's avatar Dario Seyb

optimizations

parent 88491c31
......@@ -35,6 +35,7 @@ uniform float uTime;
uniform mat4 uModelMatrix;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uInverseModelMatrix;
uniform mat4 uPrevModelMatrix;
uniform mat4 uPrevViewProjectionMatrix;
......@@ -92,18 +93,15 @@ void main()
if(sampl > color.a) discard;*/
vec4 thisPosition = uViewProjectionMatrix * vec4(inPosition, 1);
vec4 prevPosition = uPrevViewProjectionMatrix * uPrevModelMatrix * inverse(uModelMatrix) * vec4(inPosition, 1);
vec4 prevPosition = uPrevViewProjectionMatrix * uPrevModelMatrix * uInverseModelMatrix * vec4(inPosition, 1);
vec3 prevFragCoord = prevPosition.xyz/prevPosition.w;
vec3 thisFragCoord = thisPosition.xyz/thisPosition.w;
vec4 specularSmoothness = specularSmoothness();
vec3 thisFragCoord = thisPosition.xyz/thisPosition.w;
oMotion = (thisFragCoord-prevFragCoord)*0.5;
oMotion.z = thisPosition.z;
oColor = color;
oEmissive = emissive();
oSpecularSmoothness = specularSmoothness;
oSpecularSmoothness = specularSmoothness();
oNormal = normalize(normal());
}
......@@ -20,11 +20,11 @@ vec3 position();
void main()
{
vNormal = normal();
vTexCoord = texCoord();
vPosition = position();
gl_Position = uViewProjectionMatrix * vec4(vPosition, 1);
// Logarithmic Depth buffer
//float Fcoef = 2.0 / log2(uFar + 1.0);
......
#define LAST_SHADER TESSELATION
#define LAST_SHADER VERTEX
#pragma import "CommonDeferredFrag.glsl"
#pragma import "Utils.glsl"
......@@ -8,7 +8,7 @@ void initShader(){};
vec4 color() {
vec4 res = uTintColor;
if(uHasAlbedoMap) {
res *= texture(uTexture, teTexCoord).rgba;
res *= texture(uTexture, vTexCoord).rgba;
}
return res;
}
......@@ -19,28 +19,28 @@ vec4 emissive() {
vec3 normal() {
if(false && uHasNormalMap) {
vec3 tangentNormal = unpackNormal(texture(uNormalMap, teTexCoord));
vec3 tangentNormal = unpackNormal(texture(uNormalMap, vTexCoord));
vec3 Q1 = dFdx(tePosition);
vec3 Q2 = dFdy(tePosition);
vec2 st1 = dFdx(teTexCoord);
vec2 st2 = dFdy(teTexCoord);
vec3 Q1 = dFdx(vPosition);
vec3 Q2 = dFdy(vPosition);
vec2 st1 = dFdx(vTexCoord);
vec2 st2 = dFdy(vTexCoord);
vec3 T = normalize(Q1*st2.t - Q2*st1.t);
vec3 B = normalize(-Q1*st2.s + Q2*st1.s);
// the transpose of texture-to-eye space matrix
mat3 TBN = mat3(T, B, teNormal);
mat3 TBN = mat3(T, B, vNormal);
// transform the normal to eye space
return tangentNormal*TBN;
}
return teNormal;
return vNormal;
}
vec4 specularSmoothness() {
if(uHasSpecularSmoothnessMap) {
return texture(uSpecularSmoothnessMap, inTexCoord);
return texture(uSpecularSmoothnessMap, vTexCoord);
}
return vec4(1, 1, 1, 1);
}
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#define LAST_SHADER TESSELATION
#define LAST_SHADER VERTEX
#pragma import "CommonDeferredFrag.glsl"
#pragma import "Utils.glsl"
......@@ -11,11 +11,11 @@ vec4 color() {
}
vec4 emissive() {
return texture(uTexture, teTexCoord).rgba * uEmissiveColor;
return texture(uTexture, vTexCoord).rgba * uEmissiveColor;
}
vec3 normal() {
return teNormal;
return vNormal;
}
vec4 specularSmoothness() {
......
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#define LAST_SHADER TESSELATION
#define LAST_SHADER VERTEX
#pragma import "../CommonDeferredFrag.glsl"
#pragma import "../Utils.glsl"
......@@ -11,7 +11,8 @@ vec4 color() {
}
vec4 emissive() {
vec2 texCoord = teTexCoord;
vec2 texCoord = vTexCoord;
if(uTime > 7.5) {
float time = (uTime - 7.5);
texCoord.x += time * 0.2 * min(time, 2) * 0.5;
......@@ -29,7 +30,7 @@ vec4 emissive() {
}
vec3 normal() {
return teNormal;
return vNormal;
}
vec4 specularSmoothness() {
......
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#define LAST_SHADER TESSELATION
#define LAST_SHADER VERTEX
#pragma import "../CommonDeferredFrag.glsl"
#pragma import "../Utils.glsl"
......@@ -10,13 +10,13 @@ vec4 color() {
}
vec4 emissive() {
vec4 res = vec4(0.6 + 0.5 * teTexCoord.x, 0.2 + 0.4 * teTexCoord.y, 0.2, 1) * (sin(uTime * 20) * cos(uTime * 2) * 0.5 + 1.4) * min(uTime/10 + 0.1, 1);
vec4 res = vec4(0.6 + 0.5 * vTexCoord.x, 0.2 + 0.4 * vTexCoord.y, 0.2, 1) * (sin(uTime * 20) * cos(uTime * 2) * 0.5 + 1.4) * min(uTime/10 + 0.1, 1);
res.a = 1;
return res * uEmissiveColor;
}
vec3 normal() {
return teNormal;
return vNormal;
}
vec4 specularSmoothness() {
......
#version 410 core
layout(vertices = 3) out;
in vec3 vPosition[];
in vec2 vTexCoord[];
in vec3 vNormal[];
out vec3 tNormal[];
out vec2 tTexCoord[];
out vec3 tPosition[];
//patch out vec3 tPosition;
//patch out vec3 tNormal;
//patch out vec2 tTexCoord;
#define ID gl_InvocationID
void main(){
tNormal[ID] = vNormal[ID];
tTexCoord[ID] = vTexCoord[ID];
tPosition[ID] = vPosition[ID];
if (ID == 0) {
gl_TessLevelInner[0] = 1;
gl_TessLevelOuter[0] = 1;
gl_TessLevelOuter[1] = 1;
gl_TessLevelOuter[2] = 1;
}
}
#version 410 core
layout(triangles, equal_spacing, ccw) in;
in vec2 tTexCoord[];
in vec3 tNormal[];
in vec3 tPosition[];
out vec3 teNormal;
out vec2 teTexCoord;
out vec3 tePosition;
uniform mat4 uViewProjectionMatrix;
uniform mat4 uModelMatrix;
vec2 interpolate2D(vec2 v0, vec2 v1, vec2 v2){
return vec2(gl_TessCoord.x) * v0 + vec2(gl_TessCoord.y) * v1 + vec2(gl_TessCoord.z) * v2;
}
vec3 interpolate3D(vec3 v0, vec3 v1, vec3 v2){
return vec3(gl_TessCoord.x) * v0 + vec3(gl_TessCoord.y) * v1 + vec3(gl_TessCoord.z) * v2;
}
void main(){
teNormal = interpolate3D(tNormal[0], tNormal[1], tNormal[2]);
teNormal = normalize(teNormal);
teTexCoord = interpolate2D(tTexCoord[0], tTexCoord[1], tTexCoord[2]);
tePosition = interpolate3D(tPosition[0], tPosition[1], tPosition[2]);
gl_Position = uViewProjectionMatrix * vec4(tePosition, 1.0);
}
#version 330
layout(lines) in;
layout(triangle_strip, max_vertices = 4) out;
void main(void){
// From: http://stackoverflow.com/questions/12758192/wide-lines-in-geometry-shader-behaves-oddly
vec3 ndc0 = gl_in[0].gl_Position.xyz / gl_in[0].gl_Position.w;
vec3 ndc1 = gl_in[1].gl_Position.xyz / gl_in[1].gl_Position.w;
vec2 lineScreenForward = normalize(ndc1.xy - ndc0.xy);
vec2 lineScreenRight = vec2(-lineScreenForward.y, lineScreenForward.x);
vec2 lineScreenOffset = (vec2(2.0) / vec2(1280.0, 720.0)) * lineScreenRight;
if ( ndc0.z < 0 || ndc1.z < 0 || ndc0.z > 1 || ndc1.z > 1 )
return;
//gl_Position = vec4(ndc0.xy + lineScreenOffset, ndc0.z, 1.0);
vec4 cpos = gl_in[0].gl_Position;
gl_Position = vec4(cpos.xy + lineScreenOffset*cpos.w, cpos.z, cpos.w);
EmitVertex();
gl_Position = vec4(ndc0.xy - lineScreenOffset, ndc0.z, 1.0);
EmitVertex();
gl_Position = vec4(ndc1.xy + lineScreenOffset, ndc1.z, 1.0);
EmitVertex();
gl_Position = vec4(ndc1.xy - lineScreenOffset, ndc1.z, 1.0);
EmitVertex();
EndPrimitive();
}
......@@ -65,7 +65,7 @@ bool init( bool forceDebuggingContext )
OpenGL::initRuntimeDependentLimits();
// if possible, register debug callback:
OpenGL::ACGLRegisterDefaultDebugCallback();
//OpenGL::ACGLRegisterDefaultDebugCallback();
return true;
......
; This file contains the counters to configure using the Nsight VSE Frame Profiler.
; The counters can be configured for the domains common, graphics, and compute individually.
; To obtain a list of supported counters, please use NvPmApiQuery.exe ($NSIGHT_INSTALL_PATH\Host\Common\Injection32).
; For example, execute 'NvPmApiQuery.exe --gl' or 'NvPmApiQuery.exe --d3d11' on the target to obtain a list of supported OpenGL or D3D11 counters respectively.
; Executing 'NvPmApiQuery.exe --help' will show more available options.
; The configuration uses one regex for each of the domains. Here are some examples:
; 1. collect texture_busy and geom_busy only:
; graphics "texture_busy|"\
; "geom_busy"
; 2. collect read sector counters from all subpartitions and framebuffers:
; common "fb_subp\\d_read_sectors_fb\\d"
; 3. collect all common counters:
; common ".*"
; 4. collect aggregated compute counters:
; compute "^((?!(vsm|slice|gpc|subp)).)*$"
; 5. collect no common counters:
; common ""
counters
{
common ""
graphics ""
compute "^((?!(vsm|slice|gpc|subp)).)*$"
}
......@@ -71,7 +71,6 @@ private:
ACGL::OpenGL::SharedFrameBufferObject m_primaryCompositingBuffer;
ACGL::OpenGL::SharedFrameBufferObject m_secondaryCompositingBuffer;
ACGL::OpenGL::SharedFrameBufferObject m_postfxTargetBuffer;
ACGL::OpenGL::SharedFrameBufferObject m_txaaHistoryBuffer;
GLuint Feedback;
GLuint Feedback2;
......@@ -82,8 +81,6 @@ private:
SharedShaderProgram m_passBlitProgram;
SharedShaderProgram m_shadowMapProg;
SharedShaderProgram m_pbrProg;
SharedShaderProgram m_txaaProg;
SharedShaderProgram m_tfShaderProg;
......
......@@ -45,7 +45,7 @@ bool GameLoopSystem::startup() {
ImGui::Text("- Post FX: %.5f ms", m_renderer->m_lastPostprocessingTime);
ImGui::Text("Wait for Swap:%.5f ms", m_lastSwapTime);
ImGui::Separator();
ImGui::PlotHistogram("", m_frameTimeHistory.data(), m_frameTimeHistory.size(), 0, NULL, 0, 33, glm::vec2(250, 100));
ImGui::PlotHistogram("", m_frameTimeHistory.data(), m_frameTimeHistory.size(), 0, NULL, 0, 100, glm::vec2(250, 100));
ImGui::Separator();
ImGui::Text("Mouse Position: (%.1f,%.1f)", ImGui::GetIO().MousePos.x, ImGui::GetIO().MousePos.y);
ImGui::End();
......
......@@ -95,6 +95,8 @@ bool WindowSystem::createWindow() {
#ifdef _DEBUG
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
#else
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, 0);
#endif
m_glContext = SDL_GL_CreateContext(m_sdlWindow);
......@@ -106,7 +108,10 @@ bool WindowSystem::createWindow() {
return false;
}
ACGL::init();
if (!ACGL::init(false)) {
error() << "Failed to init ACGL!" << endl;
return false;
}
// Use Vsync
if (SDL_GL_SetSwapInterval(1) < 0) {
......
......@@ -46,12 +46,12 @@ bool RendererSystem::startup() {
auto windowSize = m_window->getSize();
glViewport(0, 0, windowSize.x, windowSize.y);
m_colorBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F);
m_emissiveBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F);
m_normalBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGB32F);
m_motionBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGB32F);
m_colorBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA16F);
m_emissiveBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA16F);
m_normalBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA16F);
m_motionBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA16F);
m_depthBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_DEPTH24_STENCIL8);
m_specularBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F);
m_specularBuffer = createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA16F);
m_gBufferObject = SharedFrameBufferObject(new FrameBufferObject());
m_gBufferObject->attachColorTexture("oColor", m_colorBuffer);
......@@ -75,11 +75,6 @@ bool RendererSystem::startup() {
m_postfxTargetBuffer->attachColorTexture("oColor", createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F));
m_postfxTargetBuffer->validate();
m_txaaHistoryBuffer = SharedFrameBufferObject(new FrameBufferObject());
m_txaaHistoryBuffer->attachColorTexture("oColor", createScreenspaceTexture(ScreenSpaceSize::FULL, GL_RGBA32F));
m_txaaHistoryBuffer->validate();
// Create two VABs to store transform feedback vertices. Size is a bit tricky because nobody knows how much
// vertices the tessellation shader creates.
......@@ -190,8 +185,6 @@ bool RendererSystem::startup() {
ImGui::End();
});
glGetError();
return true;
}
......@@ -224,7 +217,6 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
auto gBufferRes = m_gBufferObject->getSize();
glViewport(0, 0, gBufferRes.x, gBufferRes.y);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
auto origPos = trans->lastGlobalTransform.pos + (trans->thisGlobalTransform.pos - trans->lastGlobalTransform.pos)*interp;
......@@ -268,6 +260,7 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
// First pass - render to the transform feedback buffer:
for (size_t i = 0; i < pass.submittedDrawCallsOpaque.size(); i++) {
auto counter2Start = SDL_GetPerformanceCounter();
......@@ -355,6 +348,7 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
drawCall.material.prog->setUniform("uEmissiveColor", drawCall.material.emissiveColor);
drawCall.material.prog->setUniform("uModelMatrix", static_cast<glm::mat4>(drawCall.thisRenderTransform));
drawCall.material.prog->setUniform("uInverseModelMatrix", static_cast<glm::mat4>(glm::inverse(drawCall.thisRenderTransform)));
drawCall.material.prog->setUniform("uViewProjectionMatrix", viewProjectionMatrix);
drawCall.material.prog->setUniform("cameraPosition", glm::vec3{ camPos.x, camPos.y, camPos.z });
......@@ -369,8 +363,8 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
glEnable(GL_CULL_FACE);
glCullFace(drawCall.material.cullSide);
}
drawCall.geometry.vao->render();
glGetError();
}
// Render feedback buffer 1
......@@ -389,6 +383,8 @@ void RendererSystem::render(RenderPass& pass, double interp, double totalTime) {
}
m_lastGBufferRenderTime = (double)(SDL_GetPerformanceCounter() - counterStart) * 1000.0 / SDL_GetPerformanceFrequency();
counterStart = SDL_GetPerformanceCounter();
......@@ -644,6 +640,7 @@ void RendererSystem::frame(double interp, double totalTime) {
m_postfxTargetBuffer = temp;
}
glViewport(0, 0, m_window->getSize().x, m_window->getSize().y);
// Blit to backbuffer with tonemapping
glBindFramebuffer(GL_FRAMEBUFFER, 0);
......@@ -655,8 +652,6 @@ void RendererSystem::frame(double interp, double totalTime) {
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); // create 2 triangles (defined in shader) with no attributes
m_lastPostprocessingTime = (double)(SDL_GetPerformanceCounter() - counterStart) * 1000.0 / SDL_GetPerformanceFrequency();
glFinish();
}
void RendererSystem::shutdown() {
......
......@@ -46,10 +46,6 @@ bool OrbitalSimulationSystem::startup() {
defaultGeom = { vaoSphere };
defaultGeom.vao->setMode(GL_PATCHES);
auto pbrShader = ShaderProgramFileManager::the()->get(ShaderProgramCreator("PBR")
.attributeLocations(vaoSphere->getAttributeLocations())
.fragmentDataLocations(m_renderer->getGBufferLocations()));
auto testShader = ShaderProgramFileManager::the()->get(ShaderProgramCreator("lines")
.attributeLocations(vaoCircle->getAttributeLocations())
.fragmentDataLocations(m_renderer->getGBufferLocations()));
......
......@@ -82,7 +82,7 @@ bool AtmosphereTestScene::startup() {
m_renderer->setRenderPassActive("Minimap"_sh, false);
m_renderer->addRenderPass(consoleCamera, "Console"_sh, ScreenSpaceSize::HALF);