Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
fe4600c
make mitsuba loader compile by default
Sep 27, 2025
8b6b210
draft the scene asset
Sep 27, 2025
ab9e7b8
start reworking the Mitsuba Loader into a Scene Loader
Sep 27, 2025
99c1b8a
start the loader
Oct 9, 2025
972fd57
Note that `nbl::ext::MitsubaLoader::ParserManager::ElementPool` proba…
Oct 9, 2025
1ab734c
remove global variables and rewrite `PropertyElement.h` and `Property…
Oct 10, 2025
99c5f70
get rid of `CElementFactory`, rewrite ParserUtil to be threadsafe and…
Oct 14, 2025
3446e19
add good header guards
Oct 15, 2025
36c6aa6
really need that new PCH and lib breakdown
Oct 15, 2025
f850ce7
enable a few elements and get stuff parsing (with unhandled element e…
Oct 15, 2025
1eb3eb9
get some parsing going
Oct 15, 2025
9745682
I am very sick in the head.
Oct 16, 2025
35d4a0a
now get it to compile
Oct 16, 2025
51dc3aa
This is a neat rewrite!
Oct 16, 2025
0e1d4c2
try to pick up where I left off
Oct 21, 2025
85c3b5a
make CElementFilm work
Dec 21, 2025
ade7a8a
refactor CElementIntegrator
Dec 21, 2025
8cc4662
refactor CElementEmissionProfile and CElementRFilter, also spot we ne…
Dec 21, 2025
3d8358a
didn't notice that can't register two callbacks for same property nam…
Dec 21, 2025
7c03255
fix transform handling and realize unit test cases can be wrong too
Dec 22, 2025
70eb689
can't believe I spent an hour on this
Dec 22, 2025
0e38e80
fix lookat matrices
Dec 22, 2025
1a17718
MAke CElementShape parse, also add logger to processChildData
Dec 22, 2025
49ffbc6
implement `CElementTexture` and `CElementEmitter`, also refactor the …
Dec 22, 2025
4fc80d8
CElementBSDF is done!
Dec 23, 2025
ab505fe
fix bugs (most importantly <ref> handling)
Dec 23, 2025
078899f
fix all MitsubaLoader bugs which came up during parsing tests
Dec 24, 2025
846a383
oopsie pushed a dangling submodule pointer last commit
Dec 24, 2025
aad78bb
fix a small typo in CElementBSDF::MixtureBSDF
Dec 24, 2025
68ae0e3
Merge remote-tracking branch 'remotes/origin/master' into material_co…
Dec 24, 2025
3d61b44
pre-merge `examples_tests` submodule pointer update
Dec 29, 2025
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 CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ option(NBL_BUILD_DPL "Enable DPL (Dynamic Parallelism Library)" OFF)
option(NBL_PCH "Enable pre-compiled header" ON)
option(NBL_FAST_MATH "Enable fast low-precision math" OFF) # the reason OFF is by default now is the var controling it at build time was set AFTER BuildConfigOptions was generated - resulting in the feature being always OFF regardless the value xD - so just for sanity, keeping the same behaviour by default
option(NBL_BUILD_EXAMPLES "Enable building examples" ON)
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" OFF) # TODO: once it compies turn this ON by default!
option(NBL_BUILD_MITSUBA_LOADER "Enable nbl::ext::MitsubaLoader?" ON)
option(NBL_BUILD_IMGUI "Enable nbl::ext::ImGui?" ON)
option(NBL_BUILD_DEBUG_DRAW "Enable Nabla Debug Draw extension?" ON)

Expand Down
2 changes: 1 addition & 1 deletion CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"NBL_UPDATE_GIT_SUBMODULE": "OFF",
"NBL_COMPILE_WITH_CUDA": "OFF",
"NBL_BUILD_OPTIX": "OFF",
"NBL_BUILD_MITSUBA_LOADER": "OFF",
"NBL_BUILD_MITSUBA_LOADER": "ON",
"NBL_BUILD_RADEON_RAYS": "OFF",
"_NBL_COMPILE_WITH_OPEN_EXR_": "ON",
"NBL_EXPLICIT_MODULE_LOAD_LOG": "ON",
Expand Down
36 changes: 18 additions & 18 deletions include/nbl/asset/IAsset.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,24 @@ class IAsset : virtual public core::IReferenceCounted
//!
inline bool isMutable() const {return m_mutable;}

inline void visitDependents(std::function<bool(const IAsset*)> visit) const
{
visitDependents_impl([&visit](const IAsset* dep)->bool
{
if (dep)
return visit(dep);
return true;
});
}

inline void visitDependents(std::function<bool(IAsset*)> visit)
{
assert(isMutable());
visitDependents([&](const IAsset* dependent) -> bool
{
return visit(const_cast<IAsset*>(dependent));
});
}
inline void visitDependents(std::function<bool(const IAsset*)> visit) const
{
visitDependents_impl([&visit](const IAsset* dep)->bool
{
if (dep)
return visit(dep);
return true;
});
}

inline void visitDependents(std::function<bool(IAsset*)> visit)
{
assert(isMutable());
visitDependents([&](const IAsset* dependent) -> bool
{
return visit(const_cast<IAsset*>(dependent));
});
}

virtual bool valid() const = 0;

Expand Down
4 changes: 2 additions & 2 deletions include/nbl/asset/ICPUMorphTargets.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class NBL_API2 ICPUMorphTargets : public IAsset, public IMorphTargets<ICPUGeomet
inline E_TYPE getAssetType() const override {return AssetType;}

//
inline bool valid() const //override
inline bool valid() const override
{
for (const auto& target : m_targets)
if (!target || !target.geoCollection->valid())
Expand Down Expand Up @@ -55,7 +55,7 @@ class NBL_API2 ICPUMorphTargets : public IAsset, public IMorphTargets<ICPUGeomet

protected:
//
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const //override
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const override
{
auto nonNullOnly = [&visit](const IAsset* dep)->bool
{
Expand Down
54 changes: 54 additions & 0 deletions include/nbl/asset/ICPUScene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_ASSET_I_CPU_SCENE_H_INCLUDED_
#define _NBL_ASSET_I_CPU_SCENE_H_INCLUDED_


#include "nbl/asset/IScene.h"
// TODO: change to true IR later
#include "nbl/asset/material_compiler3/CFrontendIR.h"


namespace nbl::asset
{
//
class NBL_API2 ICPUScene : public IAsset, public IScene
{
using base_t = IScene;

public:
inline ICPUScene() = default;

constexpr static inline auto AssetType = ET_SCENE;
inline E_TYPE getAssetType() const override { return AssetType; }

inline bool valid() const override
{
return true;
}

inline core::smart_refctd_ptr<IAsset> clone(uint32_t _depth=~0u) const
{
const auto nextDepth = _depth ? (_depth-1):0;
auto retval = core::smart_refctd_ptr<ICPUScene>();
return retval;
}

protected:
//
inline void visitDependents_impl(std::function<bool(const IAsset*)> visit) const override
{
}


// suggested contents:
// - morph target list
// - material table
// - instance list (morph target, keyframed transforms, material table indexings, FUTURE: reference skeleton)
// - area light list (OBB decompositions, material table indexings)
// - envlight data
};
}

#endif
23 changes: 23 additions & 0 deletions include/nbl/asset/IScene.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_ASSET_I_SCENE_H_INCLUDED_
#define _NBL_ASSET_I_SCENE_H_INCLUDED_


#include "nbl/asset/IMorphTargets.h"


namespace nbl::asset
{
// This is incredibly temporary, lots of things are going to change
class NBL_API2 IScene : public virtual core::IReferenceCounted
{
public:

protected:
virtual ~IScene() = default;
};
}

#endif
1 change: 1 addition & 0 deletions include/nbl/asset/asset.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
#include "nbl/asset/interchange/IAssetLoader.h"
#include "nbl/asset/interchange/IImageLoader.h"
#include "nbl/asset/interchange/IGeometryLoader.h"
#include "nbl/asset/interchange/ISceneLoader.h"
#include "nbl/asset/interchange/IAssetWriter.h"
#include "nbl/asset/interchange/IImageWriter.h"
#include "nbl/asset/metadata/COpenEXRMetadata.h"
Expand Down
6 changes: 4 additions & 2 deletions include/nbl/asset/interchange/IAssetLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
#ifndef _NBL_ASSET_I_ASSET_LOADER_H_INCLUDED_
#define _NBL_ASSET_I_ASSET_LOADER_H_INCLUDED_


#include "nbl/system/declarations.h"

#include "nbl/system/ISystem.h"
#include "nbl/system/ILogger.h"

#include "nbl/asset/interchange/SAssetBundle.h"


namespace nbl::asset
{

Expand Down Expand Up @@ -86,8 +88,8 @@ class NBL_API2 IAssetLoader : public virtual core::IReferenceCounted
enum E_LOADER_PARAMETER_FLAGS : uint64_t
{
ELPF_NONE = 0, //!< default value, it doesn't do anything
ELPF_RIGHT_HANDED_MESHES = 0x1, //!< specifies that a mesh will be flipped in such a way that it'll look correctly in right-handed camera system
ELPF_DONT_COMPILE_GLSL = 0x2, //!< it states that GLSL won't be compiled to SPIR-V if it is loaded or generated
/*deprecated*/ELPF_RIGHT_HANDED_MESHES = 0x1, //!< specifies that a mesh will be flipped in such a way that it'll look correctly in right-handed camera system
/*deprecated*/ELPF_DONT_COMPILE_GLSL = 0x2, //!< it states that GLSL won't be compiled to SPIR-V if it is loaded or generated
ELPF_LOAD_METADATA_ONLY = 0x4 //!< it forces the loader to not load the entire scene for performance in special cases to fetch metadata.
};

Expand Down
5 changes: 2 additions & 3 deletions include/nbl/asset/interchange/IImageLoader.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
// Copyright (C) 2018-2020 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h

#ifndef __NBL_ASSET_I_IMAGE_LOADER_H_INCLUDED__
#define __NBL_ASSET_I_IMAGE_LOADER_H_INCLUDED__
#ifndef _NBL_ASSET_I_IMAGE_LOADER_H_INCLUDED_
#define _NBL_ASSET_I_IMAGE_LOADER_H_INCLUDED_

#include "nbl/core/declarations.h"

Expand Down
30 changes: 30 additions & 0 deletions include/nbl/asset/interchange/ISceneLoader.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// Copyright (C) 2025-2025 - DevSH Graphics Programming Sp. z O.O.
// This file is part of the "Nabla Engine".
// For conditions of distribution and use, see copyright notice in nabla.h
#ifndef _NBL_ASSET_I_SCENE_LOADER_H_INCLUDED_
#define _NBL_ASSET_I_SCENE_LOADER_H_INCLUDED_


#include "nbl/core/declarations.h"

#include "nbl/asset/ICPUScene.h"
#include "nbl/asset/interchange/IAssetLoader.h"


namespace nbl::asset
{

class ISceneLoader : public IAssetLoader
{
public:
virtual inline uint64_t getSupportedAssetTypesBitfield() const override {return IAsset::ET_SCENE;}

protected:
inline ISceneLoader() {}

private:
};

}

#endif
24 changes: 24 additions & 0 deletions include/nbl/core/algorithm/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,30 @@ struct type_list_size<type_list<T...>> : std::integral_constant<size_t,sizeof...
template<typename TypeList>
inline constexpr size_t type_list_size_v = type_list_size<TypeList>::value;

template<template<typename> class, typename TypeList>
struct filter;
template<template<typename> class Pred, typename... T>
struct filter<Pred,type_list<T...>>
{
using type = type_list<>;
};

template<template<typename> class Pred, typename T, typename... Ts>
struct filter<Pred,type_list<T,Ts...>>
{
template<typename, typename>
struct Cons;
template<typename Head, typename... Tail>
struct Cons<Head,type_list<Tail...>>
{
using type = type_list<Head,Tail...>;
};

using type = std::conditional_t<Pred<T>::value,typename Cons<T,typename filter<Pred,type_list<Ts...>>::type>::type,typename filter<Pred,type_list<Ts...>>::type>;
};
template<template<typename> class Pred, typename TypeList>
using filter_t = filter<Pred,TypeList>::type;

template<template<class...> class ListLikeOutT, template<class> class X, typename ListLike>
struct list_transform
{
Expand Down
3 changes: 3 additions & 0 deletions include/nbl/core/hash/blake.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
#ifndef _NBL_CORE_HASH_BLAKE3_H_INCLUDED_
#define _NBL_CORE_HASH_BLAKE3_H_INCLUDED_


#include "nbl/config/BuildConfigOptions.h"
#include "blake3.h"

#include <span>


namespace nbl::core
{
struct blake3_hash_t final
Expand Down
4 changes: 2 additions & 2 deletions include/nbl/core/string/stringutil.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ namespace core
//! DOCUMENTATION TODO
struct CaseInsensitiveHash
{
inline std::size_t operator()(const std::string& val) const
inline std::size_t operator()(const std::string_view val) const
{
std::size_t seed = 0;
for (auto it = val.begin(); it != val.end(); it++)
Expand All @@ -192,7 +192,7 @@ namespace core
};
struct CaseInsensitiveEquals
{
inline bool operator()(const std::string& A, const std::string& B) const
inline bool operator()(const std::string_view A, const std::string_view B) const
{
return core::strcmpi(A, B)==0;
}
Expand Down
Loading
Loading