Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
c92d4db
first few windows using xml
ProtectedVariable Dec 29, 2025
69fc46f
redone project selection view with xml
ProtectedVariable Dec 30, 2025
78c8a7f
started work on xml-based asset browser
ProtectedVariable Dec 30, 2025
f3b204d
WIP on new asset browser
ProtectedVariable Jan 1, 2026
3bda9c2
started refactor of render pipeline
ProtectedVariable Jan 5, 2026
f1f9637
Fix UBO issue
ProtectedVariable Jan 5, 2026
e9895e5
WIP on new asset browser
ProtectedVariable Jan 6, 2026
1f9ca19
asset preview ok
ProtectedVariable Jan 7, 2026
41907eb
add folder and shader file textures
ProtectedVariable Jan 7, 2026
846626c
start work on material editor
ProtectedVariable Jan 7, 2026
a79cb16
Fix: add unique ID to dialogs
ProtectedVariable Jan 7, 2026
e9534cd
finish material editor
ProtectedVariable Jan 8, 2026
26164eb
components edit widget -> xml + animation fix
ProtectedVariable Jan 8, 2026
94fccbe
main widget to xml
ProtectedVariable Jan 12, 2026
bd2c0e6
Some styling
ProtectedVariable Jan 13, 2026
1282224
couple fixes, add menu actions
ProtectedVariable Jan 14, 2026
c97ca3e
start split of cpu and gpu assets
ProtectedVariable Jan 14, 2026
acd6186
compiling version
ProtectedVariable Jan 15, 2026
644ba52
test build*
ProtectedVariable Jan 15, 2026
792f10f
new shader files
ProtectedVariable Jan 15, 2026
d5b8285
rendering working again
ProtectedVariable Jan 15, 2026
fd391cc
new shader IO ok
ProtectedVariable Jan 15, 2026
ba6ae21
working on new render logic with only meshes
ProtectedVariable Jan 15, 2026
4232cd8
Only store mesh ids in model
ProtectedVariable Jan 15, 2026
c797752
Re-enable ok
ProtectedVariable Jan 16, 2026
095aa05
Scenegraph system
ProtectedVariable Jan 16, 2026
58e98f0
Quaternions :)
ProtectedVariable Jan 16, 2026
2c5c3f5
s
ProtectedVariable Jan 17, 2026
d29be3a
Almost working animations (again)
ProtectedVariable Jan 20, 2026
0b9fd28
semi-fix
ProtectedVariable Jan 20, 2026
497605b
fixed animations
ProtectedVariable Jan 21, 2026
3723e22
populate default skeleton pose
ProtectedVariable Jan 21, 2026
083c939
serialization and deserialization of new components, add drag/drop of…
ProtectedVariable Jan 21, 2026
58edd72
animation component doesn't require rendercomponent anymore
ProtectedVariable Jan 21, 2026
b0cc568
Merge pull request #22 from ProtectedVariable/New-Assets
ProtectedVariable Jan 21, 2026
118a1f6
Fix missing inverse transform in bones
ProtectedVariable Jan 22, 2026
a25c779
Rework existing dialogs, fix tests build
ProtectedVariable Jan 23, 2026
208133b
Start work on shader editor
ProtectedVariable Jan 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macOS-latest, windows-latest]
os: [windows-latest]

steps:
- uses: actions/checkout@v2
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ layout (location = 6) in vec4 bone_weights;

uniform mat4 model;
uniform mat4 bonesTransformMatrices[MAX_BONES];
uniform mat4 bonesOffsetMatrices[MAX_BONES];

out vec3 fnormal;
out vec3 ftangent;
Expand Down Expand Up @@ -46,7 +45,7 @@ void main() {
break;
}

mat4 finalBonesMatrix = bonesTransformMatrices[bone_ids[i]] * bonesOffsetMatrices[bone_ids[i]];
mat4 finalBonesMatrix = bonesTransformMatrices[bone_ids[i]];

totalPosition += finalBonesMatrix * vec4(vertex, 1.0f) * bone_weights[i];

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 10 additions & 0 deletions Assets/Shaders/lastpass.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/lastpass.vs"
},
{
"stage": "fragment",
"source": "glsl/lastpass.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/normal.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skinning.vs"
},
{
"stage": "fragment",
"source": "glsl/normal.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/pbr.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skinning.vs"
},
{
"stage": "fragment",
"source": "glsl/pbr.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/phong.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skinning.vs"
},
{
"stage": "fragment",
"source": "glsl/phong.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/picking.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skinning.vs"
},
{
"stage": "fragment",
"source": "glsl/picking.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/skybox.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skybox.vs"
},
{
"stage": "fragment",
"source": "glsl/skybox.fs"
}
]
10 changes: 10 additions & 0 deletions Assets/Shaders/solid.shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"stage": "vertex",
"source": "glsl/skinning.vs"
},
{
"stage": "fragment",
"source": "glsl/solid.fs"
}
]
Binary file added Assets/Textures/Editor/folder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Textures/Editor/shader.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 0 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ include_directories(includes)
set(IMGUI_SRC
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui_impl_glfw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui_impl_opengl3.cpp
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui.cpp
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui_widgets.cpp
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui_draw.cpp
${CMAKE_CURRENT_SOURCE_DIR}/includes/ImGUI/imgui_tables.cpp
)

set(IMGUIZMO_SRC
Expand Down
7 changes: 6 additions & 1 deletion ICE/Assets/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ add_library(${PROJECT_NAME} STATIC)

target_sources(${PROJECT_NAME} PRIVATE
src/AssetBank.cpp
src/AssetPath.cpp)
src/AssetPath.cpp
src/Shader.cpp
src/Model.cpp
src/Material.cpp
src/GPURegistry.cpp
src/Texture.cpp)

target_link_libraries(${PROJECT_NAME}
PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion ICE/Assets/include/Asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace ICE {

typedef unsigned long long AssetUID;

enum class AssetType { ETex2D, ETexCube, EShader, EMesh, EModel, EMaterial };
enum class AssetType { EModel, EMesh, EMaterial, ETex2D, ETexCube, EShader, EOther };

class Asset : public Resource {
public:
Expand Down
3 changes: 1 addition & 2 deletions ICE/Assets/include/AssetBank.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ struct AssetBankEntry {

class AssetBank {
public:
AssetBank(const std::shared_ptr<GraphicsFactory>& factory);
AssetBank();

template<typename T>
std::shared_ptr<T> getAsset(AssetUID uid) {
Expand Down Expand Up @@ -167,6 +167,5 @@ class AssetBank {
std::unordered_map<AssetPath, AssetUID> nameMapping;
std::unordered_map<AssetUID, AssetBankEntry> resources;
AssetLoader loader;
std::shared_ptr<GraphicsFactory> graphics_factory;
};
} // namespace ICE
4 changes: 2 additions & 2 deletions ICE/Assets/include/AssetLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ class AssetLoader {
private:
std::unordered_map<
std::type_index,
std::variant<std::shared_ptr<IAssetLoader<Model>>, std::shared_ptr<IAssetLoader<Material>>, std::shared_ptr<IAssetLoader<Shader>>,
std::shared_ptr<IAssetLoader<Texture2D>>, std::shared_ptr<IAssetLoader<TextureCube>>>>
std::variant<std::shared_ptr<IAssetLoader<Mesh>>, std::shared_ptr<IAssetLoader<Model>>, std::shared_ptr<IAssetLoader<Material>>,
std::shared_ptr<IAssetLoader<Shader>>, std::shared_ptr<IAssetLoader<Texture2D>>, std::shared_ptr<IAssetLoader<TextureCube>>>>
loaders;
};
} // namespace ICE
43 changes: 43 additions & 0 deletions ICE/Assets/include/GPURegistry.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#pragma once

#include <GPUMesh.h>
#include <GPUTexture.h>
#include <GraphicsFactory.h>
#include <ShaderProgram.h>

#include <memory>

#include "Asset.h"
#include "AssetBank.h"
#include "Mesh.h"
#include "Shader.h"
#include "Texture.h"

namespace ICE {
class GPURegistry {
public:
GPURegistry(const std::shared_ptr<GraphicsFactory> &factory, const std::shared_ptr<AssetBank> &bank);

AssetUID getUID(const AssetPath &path) const { return m_asset_bank->getUID(path); }
std::shared_ptr<Material> getMaterial(const AssetPath &path) { return m_asset_bank->getAsset<Material>(getUID(path)); }
std::shared_ptr<Material> getMaterial(AssetUID id) { return m_asset_bank->getAsset<Material>(id); }
std::shared_ptr<ShaderProgram> getShader(AssetUID id);
std::shared_ptr<ShaderProgram> getShader(const AssetPath &path) { return getShader(getUID(path)); }
AABB getMeshAABB(AssetUID id) { return m_asset_bank->getAsset<Mesh>(id)->getBoundingBox(); }
const SkinningData &getMeshSkinningData(AssetUID id) { return m_asset_bank->getAsset<Mesh>(id)->getSkinningData(); }
std::shared_ptr<GPUMesh> getMesh(AssetUID id);
std::shared_ptr<GPUMesh> getMesh(const AssetPath &path) { return getMesh(getUID(path)); }
std::shared_ptr<GPUTexture> getTexture2D(AssetUID id);
std::shared_ptr<GPUTexture> getTexture2D(const AssetPath &path) { return getTexture2D(getUID(path)); }
std::shared_ptr<GPUTexture> getCubemap(AssetUID id);

private:
std::unordered_map<AssetUID, std::shared_ptr<ShaderProgram>> m_shader_programs;
std::unordered_map<AssetUID, std::shared_ptr<GPUMesh>> m_gpu_meshes;
std::unordered_map<AssetUID, std::shared_ptr<GPUTexture>> m_gpu_tex2d;
std::unordered_map<AssetUID, std::shared_ptr<GPUTexture>> m_gpu_cubemaps;

std::shared_ptr<GraphicsFactory> m_graphics_factory;
std::shared_ptr<AssetBank> m_asset_bank;
};
} // namespace ICE
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ class Material : public Asset {
}
}

void renameUniform(const std::string& previous_name, const std::string& new_name);
void removeUniform(const std::string& name);

std::unordered_map<std::string, UniformValue> getAllUniforms() const;
AssetUID getShader() const;
void setShader(AssetUID shader_id);
Expand Down
132 changes: 63 additions & 69 deletions ICE/Graphics/include/Mesh.h → ICE/Assets/include/Mesh.h
Original file line number Diff line number Diff line change
@@ -1,70 +1,64 @@
//
// Created by Thomas Ibanez on 16.11.20.
//

#pragma once

#include <AABB.h>
#include <Asset.h>

#include <Eigen/Dense>
#include <vector>

#include "VertexArray.h"

namespace ICE {

constexpr int MAX_BONES_PER_VERTEX = 4;
constexpr int MAX_BONES = 100;
constexpr int INVALID_BONE_ID = -1;

struct MeshData {
std::vector<Eigen::Vector3f> vertices;
std::vector<Eigen::Vector3f> normals;
std::vector<Eigen::Vector2f> uvCoords;
std::vector<Eigen::Vector3f> tangents;
std::vector<Eigen::Vector3f> bitangents;
std::vector<Eigen::Vector4i> boneIDs;
std::vector<Eigen::Vector4f> boneWeights;
std::vector<Eigen::Vector3i> indices;
};

struct SkinningData {
std::unordered_map<int, Eigen::Matrix4f> boneOffsetMatrices;
};

class Mesh : public Asset {
public:
Mesh(const MeshData &data);
Mesh(MeshData &&data);

const std::vector<Eigen::Vector3f> &getVertices() const;

const std::vector<Eigen::Vector3f> &getNormals() const;

const std::vector<Eigen::Vector2f> &getUVCoords() const;

const std::vector<Eigen::Vector3i> &getIndices() const;

const std::shared_ptr<VertexArray> getVertexArray() const;
void setVertexArray(const std::shared_ptr<VertexArray> &vao);

const AABB &getBoundingBox() const;

std::string getTypeName() const override;
AssetType getType() const override;
bool usesBones() const { return m_has_bones; }
void setSkinningData(const SkinningData &skinningData) {
m_skinningData = skinningData;
m_has_bones = true;
}

SkinningData getSkinningData() const { return m_skinningData; }
private:
MeshData m_data;
SkinningData m_skinningData;
bool m_has_bones = false;
std::shared_ptr<VertexArray> vertexArray;
AABB boundingBox;
};
//
// Created by Thomas Ibanez on 16.11.20.
//

#pragma once

#include <AABB.h>
#include <Asset.h>

#include <Eigen/Dense>
#include <vector>

#include "VertexArray.h"

namespace ICE {

constexpr int MAX_BONES_PER_VERTEX = 4;
constexpr int MAX_BONES = 100;
constexpr int INVALID_BONE_ID = -1;

struct MeshData {
std::vector<Eigen::Vector3f> vertices;
std::vector<Eigen::Vector3f> normals;
std::vector<Eigen::Vector2f> uvCoords;
std::vector<Eigen::Vector3f> tangents;
std::vector<Eigen::Vector3f> bitangents;
std::vector<Eigen::Vector4i> boneIDs;
std::vector<Eigen::Vector4f> boneWeights;
std::vector<Eigen::Vector3i> indices;
};

struct SkinningData {
std::unordered_map<int, Eigen::Matrix4f> inverseBindMatrices; //BoneID -> Inverse Bind Matrix
};

class Mesh : public Asset {
public:
Mesh(const MeshData &data);
Mesh(MeshData &&data);

const MeshData &getMeshData() const { return m_data; }

const std::vector<Eigen::Vector3f> &getVertices() const;

const std::vector<Eigen::Vector3f> &getNormals() const;

const std::vector<Eigen::Vector2f> &getUVCoords() const;

const std::vector<Eigen::Vector3i> &getIndices() const;

const AABB &getBoundingBox() const;

const SkinningData &getSkinningData() const { return m_skinningData; }
void setIBM(int boneID, const Eigen::Matrix4f &ibm) { m_skinningData.inverseBindMatrices[boneID] = ibm; }

std::string getTypeName() const override;
AssetType getType() const override;

private:
MeshData m_data;
SkinningData m_skinningData;
AABB boundingBox;
};
} // namespace ICE
Loading
Loading