mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-27 16:17:12 +03:00
Quake maps geometry batching
Rendering Optimization
This commit is contained in:
@@ -212,7 +212,7 @@ float ShadowCalculation(Light light, vec3 FragPos, vec3 normal)
|
||||
int shadowmap = -1;
|
||||
|
||||
// Get CSM depth
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
float CSMDepth = light.CascadeDepth[i] ;
|
||||
|
||||
@@ -1,20 +1,17 @@
|
||||
#shader vertex
|
||||
#version 460 core
|
||||
|
||||
layout(location = 0) in vec3 Position;
|
||||
uniform mat4 lightSpaceMatrix;
|
||||
uniform mat4 model;
|
||||
|
||||
uniform mat4 u_LightTransform;
|
||||
uniform mat4 u_Model;
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
gl_Position = lightSpaceMatrix * model * vec4(Position, 1.0);
|
||||
gl_Position = u_LightTransform * u_Model * vec4(Position, 1.0);
|
||||
}
|
||||
|
||||
#shader fragment
|
||||
#version 460 core
|
||||
|
||||
|
||||
void main()
|
||||
{
|
||||
|
||||
}
|
||||
void main() { }
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "src/Scene/Components/WrenScriptComponent.h"
|
||||
#include "src/Scene/Systems/QuakeMapBuilder.h"
|
||||
#include "src/Scene/Components/LightComponent.h"
|
||||
#include "UIComponents/Viewport.h"
|
||||
|
||||
namespace Nuake {
|
||||
Ref<UI::UserInterface> userInterface;
|
||||
@@ -53,7 +54,6 @@ namespace Nuake {
|
||||
void EditorInterface::DrawViewport()
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||
|
||||
std::string name = ICON_FA_GAMEPAD + std::string(" Scene");
|
||||
if (ImGui::Begin(name.c_str()))
|
||||
{
|
||||
@@ -125,7 +125,6 @@ namespace Nuake {
|
||||
ImGui::PopStyleVar();
|
||||
}
|
||||
ImGui::End();
|
||||
|
||||
}
|
||||
|
||||
static int selected = 0;
|
||||
|
||||
21
Editor/src/UIComponents/Viewport.cpp
Normal file
21
Editor/src/UIComponents/Viewport.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "Viewport.h"
|
||||
#include <src/Vendors/imgui/imgui.h>
|
||||
|
||||
Viewport::Viewport(const std::string& name, Ref<Nuake::Texture> texture)
|
||||
{
|
||||
Name = name;
|
||||
Texture = texture;
|
||||
}
|
||||
|
||||
void Viewport::Draw()
|
||||
{
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0));
|
||||
|
||||
if (ImGui::Begin(Name.c_str()))
|
||||
{
|
||||
ImGui::Image((void*)Texture->GetID(), ImGui::GetContentRegionAvail(), ImVec2(0, 1), ImVec2(1, 0));
|
||||
}
|
||||
ImGui::PopStyleVar();
|
||||
|
||||
ImGui::End();
|
||||
}
|
||||
13
Editor/src/UIComponents/Viewport.h
Normal file
13
Editor/src/UIComponents/Viewport.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
#include "Engine.h"
|
||||
#include "src/Rendering/Textures/Texture.h"
|
||||
|
||||
class Viewport
|
||||
{
|
||||
public:
|
||||
std::string Name = "";
|
||||
Ref<Nuake::Texture> Texture;
|
||||
|
||||
Viewport(const std::string& name, Ref<Nuake::Texture> texture);
|
||||
void Draw();
|
||||
};
|
||||
Reference in New Issue
Block a user