Skip to content

Commit 2260f07

Browse files
committed
Merge branch 'master' of https://github.com/Devsh-Graphics-Programming/Nabla into loadersFix
2 parents f24ddec + 75009e8 commit 2260f07

File tree

63 files changed

+1401
-1430
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1401
-1430
lines changed

.github/workflows/repo_mirroring_workflow.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

README.md

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
44

5-
**Nabla**(previously called **[IrrlichtBaW](https://github.com/buildaworldnet/IrrlichtBAW)** is a new renovated version of older **[Irrlicht](http://irrlicht.sourceforge.net/)** engine.
5+
**Nabla** (previously called **[IrrlichtBaW](https://github.com/buildaworldnet/IrrlichtBAW)** ) is a new renovated version of older **[Irrlicht](http://irrlicht.sourceforge.net/)** engine.
66
The name change to Nabla allows for using Nabla side by side with the legacy Irrlicht and IrrlichtBaW engines.
77
The project currently aims for a thread-able and *Vulkan*-centered API, but currently works on *OpenGL* only.
88

@@ -63,15 +63,21 @@ Contact ***[@devshgraphicsprogramming](https://github.com/devshgraphicsprogrammi
6363

6464

6565

66-
### [Delta BRDF Test](https://www.youtube.com/watch?v=jIJWG0eaxU8)
66+
### [Bathroom Scene Raytracing](https://www.youtube.com/watch?t=28&v=vqKZKP1hYcc&feature=youtu.be)
6767

68+
![](https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/1209ac2a076762a3f75647e7e556b2dfd3925536/site_media/readme/gifs/raytracingflythrough/raytracing%207.gif)
6869

6970

70-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/ad02c69e384c6655951c99d3b4bee5178a9dab2f/site_media/readme/gifs/myballs/Delta%20BRDF%20Test%201.gif?raw=true)
7171

72+
![](https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/1209ac2a076762a3f75647e7e556b2dfd3925536/site_media/readme/gifs/raytracingflythrough/raytracing%208.gif)
7273

7374

74-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/ad02c69e384c6655951c99d3b4bee5178a9dab2f/site_media/readme/gifs/myballs/Delta%20BRDF%20Test%202.gif?raw=true)
75+
76+
### [Stairs Scene Raytracing](https://www.youtube.com/watch?v=2uRBiLdvva4)
77+
78+
79+
80+
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/1209ac2a076762a3f75647e7e556b2dfd3925536/site_media/readme/gifs/raytracingflythrough/raytracing%206.gif?raw=true)
7581

7682

7783

@@ -109,35 +115,14 @@ Contact ***[@devshgraphicsprogramming](https://github.com/devshgraphicsprogrammi
109115

110116
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/denoisingalbedoandnormals/denoising%207.gif?raw=true)
111117

112-
113118
### [Raytracing flythrough](https://www.youtube.com/watch?v=bwVVoAsRjHI)
114119

115-
116-
117-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/raytracingflythrough/raytracing%201.gif?raw=true)
118-
119-
120-
121120
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/raytracingflythrough/raytracing%202.gif?raw=true)
122121

123-
124-
125-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/raytracingflythrough/raytracing%203.gif?raw=true)
126-
127-
128-
129122
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/raytracingflythrough/raytracing%204.gif?raw=true)
130123

131-
132-
133-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/gifs/raytracingflythrough/raytracing%205.gif?raw=true)
134-
135-
136-
137124
### Screenshots
138125

139-
### Screen Shots
140-
141126
##### <u>Pseudo Spectral rendering</u>
142127

143128
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/ad02c69e384c6655951c99d3b4bee5178a9dab2f/site_media/readme/screenshots/myballs/spectral%20renderering.png?raw=true)
@@ -146,13 +131,13 @@ Contact ***[@devshgraphicsprogramming](https://github.com/devshgraphicsprogrammi
146131

147132
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/ad02c69e384c6655951c99d3b4bee5178a9dab2f/site_media/readme/screenshots/myballs/thindielectric.png?raw=true)
148133

149-
##### <u>Over 10 area lights</u>
134+
**<u>Stairs raytracing</u>**
150135

151-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/screenshots/Over%2010%20area%20lights.png?raw=true)
136+
![](https://raw.githubusercontent.com/Devsh-Graphics-Programming/Nabla/c727e929e45e3fe6af824eae4c296ae82f538dff/site_media/readme/screenshots/RTAA.png)
152137

153-
##### <u>Raytracing sample</u>
138+
**<u>Bathroom raytracing</u>**
154139

155-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/screenshots/Raytracing%20sample.png?raw=true)
140+
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/1209ac2a076762a3f75647e7e556b2dfd3925536/site_media/readme/screenshots/BathroomScene.png?raw=true)
156141

157142
##### <u>Raytracing sample</u>
158143

@@ -162,10 +147,6 @@ Contact ***[@devshgraphicsprogramming](https://github.com/devshgraphicsprogrammi
162147

163148
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/screenshots/1%20Megapixel,%201%20Million%20Samples.png?raw=true)
164149

165-
##### <u>Raytracing sample</u>
166-
167-
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/screenshots/Raytracing%20sample%203.png?raw=true)
168-
169150
##### <u>BRDF Explorer</u>
170151

171152
![](https://github.com/Devsh-Graphics-Programming/Nabla/blob/6e4842588ef02ffb619242a08c0c037bba59c244/site_media/readme/screenshots/BRDF%20Explorer.png?raw=true)

examples_tests/06.MeshLoaders/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ int main()
5858

5959
auto* qnc = am->getMeshManipulator()->getQuantNormalCache();
6060
//loading cache from file
61-
qnc->loadNormalQuantCacheFromFile<asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10>(fs, "../../tmp/normalCache101010.sse", true);
61+
qnc->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
6262

6363
// register the zip
6464
device->getFileSystem()->addFileArchive("../../media/sponza.zip");
@@ -73,7 +73,7 @@ int main()
7373
mesh_raw = static_cast<asset::ICPUMesh*>(mesh.get());
7474

7575
//saving cache to file
76-
qnc->saveCacheToFile(asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10, fs, "../../tmp/normalCache101010.sse");
76+
qnc->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs,"../../tmp/normalCache101010.sse");
7777
}
7878

7979
//we can safely assume that all meshbuffers within mesh loaded from OBJ has same DS1 layout (used for camera-specific data)

examples_tests/18.MitsubaLoader/main.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,18 @@ void main()
106106
107107
// "The sign of this computation is negated when the value of GL_CLIP_ORIGIN (the clip volume origin, set with glClipControl) is GL_UPPER_LEFT."
108108
const bool front = (!gl_FrontFacing) != (PC.camTformDeterminant*InstData.data[InstanceIndex].determinant < 0.0);
109-
nbl_glsl_MC_precomputed_t precomp = nbl_glsl_precomputeData(front);
109+
precomp = nbl_glsl_MC_precomputeData(front);
110+
material = nbl_glsl_MC_material_data_t_getOriented(InstData.data[InstanceIndex].material,precomp.frontface);
110111
#ifdef TEX_PREFETCH_STREAM
111-
nbl_glsl_runTexPrefetchStream(getTexPrefetchStream(precomp), UV, dUV);
112+
nbl_glsl_MC_runTexPrefetchStream(nbl_glsl_MC_oriented_material_t_getTexPrefetchStream(material), UV, dUV);
112113
#endif
113114
#ifdef NORM_PRECOMP_STREAM
114-
nbl_glsl_runNormalPrecompStream(getNormalPrecompStream(precomp), dUV, precomp);
115+
nbl_glsl_MC_runNormalPrecompStream(nbl_glsl_MC_oriented_material_t_getNormalPrecompStream(precomp), dUV, precomp);
115116
#endif
116117
117118
118-
nbl_glsl_IsotropicViewSurfaceInteraction inter;
119-
vec3 color = nbl_computeLighting(inter, dUV, precomp);
119+
nbl_glsl_AnisotropicViewSurfaceInteraction inter;
120+
vec3 color = nbl_computeLighting(inter, dUV);
120121
121122
OutColor = vec4(color, 1.0);
122123
}
@@ -212,8 +213,6 @@ int main()
212213

213214
auto serializedLoader = core::make_smart_refctd_ptr<nbl::ext::MitsubaLoader::CSerializedLoader>(am);
214215
auto mitsubaLoader = core::make_smart_refctd_ptr<nbl::ext::MitsubaLoader::CMitsubaLoader>(am,fs);
215-
serializedLoader->initialize();
216-
mitsubaLoader->initialize();
217216
am->addAssetLoader(std::move(serializedLoader));
218217
am->addAssetLoader(std::move(mitsubaLoader));
219218

@@ -263,11 +262,11 @@ int main()
263262
}
264263

265264
//! read cache results -- speeds up mesh generation
266-
//qnc->loadNormalQuantCacheFromFile<asset::E_QUANT_NORM_CACHE_TYPE::Q_2_10_10_10>(fs, "../../tmp/normalCache101010.sse", true);
265+
qnc->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
267266
//! load the mitsuba scene
268267
meshes = am->getAsset(filePath, {});
269268
//! cache results -- speeds up mesh generation on second run
270-
qnc->saveCacheToFile(asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10, fs, "../../tmp/normalCache101010.sse");
269+
qnc->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
271270

272271
auto contents = meshes.getContents();
273272
if (contents.begin()>=contents.end())
@@ -323,6 +322,7 @@ int main()
323322

324323
video::IVideoDriver* driver = device->getVideoDriver();
325324
asset::IAssetManager* am = device->getAssetManager();
325+
io::IFileSystem* fs = device->getFileSystem();
326326

327327
// look out for this!!!
328328
// when added, CMitsubaLoader inserts its own include loader into GLSLCompiler

examples_tests/21.DynamicTextureIndexing/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main()
5050
//
5151
auto* qnc = am->getMeshManipulator()->getQuantNormalCache();
5252
//loading cache from file
53-
qnc->loadNormalQuantCacheFromFile<asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10>(fs, "../../tmp/normalCache101010.sse", true);
53+
qnc->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
5454

5555
// register the zip
5656
device->getFileSystem()->addFileArchive("../../media/sponza.zip");
@@ -62,7 +62,7 @@ int main()
6262
auto mesh_raw = static_cast<asset::ICPUMesh*>(mesh.get());
6363

6464
//saving cache to file
65-
qnc->saveCacheToFile(asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10, fs, "../../tmp/normalCache101010.sse");
65+
qnc->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
6666

6767
const auto meta = meshes_bundle.getMetadata()->selfCast<const COBJMetadata>();
6868

examples_tests/22.RaytracedAO/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ int main()
9696
asset::CQuantNormalCache* qnc = am->getMeshManipulator()->getQuantNormalCache();
9797

9898
//! read cache results -- speeds up mesh generation
99-
qnc->loadNormalQuantCacheFromFile<asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10>(fs, "../../tmp/normalCache101010.sse", true);
99+
qnc->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
100100
//! load the mitsuba scene
101101
meshes = am->getAsset(filePath, {});
102102
//! cache results -- speeds up mesh generation on second run
103-
qnc->saveCacheToFile(asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10, fs, "../../tmp/normalCache101010.sse");
103+
qnc->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
104104

105105
auto contents = meshes.getContents();
106106
if (!contents.size())

examples_tests/26.MultidrawIndirectVSCPUCull/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ int main()
101101

102102
auto* qnc = am->getMeshManipulator()->getQuantNormalCache();
103103
//loading cache from file
104-
if (!qnc->loadNormalQuantCacheFromFile<asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10>(fs, "../../tmp/normalCache101010.sse", true))
104+
if (!qnc->loadCacheFromFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse"))
105105
os::Printer::log("Failed to load cache.");
106106

107107
constexpr auto kInstanceCount = 8192;
@@ -202,7 +202,7 @@ int main()
202202
}
203203

204204
//! cache results -- speeds up mesh generation on second run
205-
qnc->saveCacheToFile(asset::CQuantNormalCache::E_CACHE_TYPE::ECT_2_10_10_10, fs, "../../tmp/normalCache101010.sse");
205+
qnc->saveCacheToFile<asset::EF_A2B10G10R10_SNORM_PACK32>(fs, "../../tmp/normalCache101010.sse");
206206

207207
//
208208
gpuDrawDirectPipeline = driver->getGPUObjectsFromAssets(&cpuDrawDirectPipeline.get(),&cpuDrawDirectPipeline.get()+1)->operator[](0);

examples_tests/tmp/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/rtSamples.bin
1+
./rtSamples.bin
2+
./normalCache101010.sse
-52 KB
Binary file not shown.

include/nbl/asset/IAsset.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ class IAsset : virtual public core::IReferenceCounted
177177
return false;
178178

179179
restoreFromDummy_impl(_other, _levelsBelow);
180+
isDummyObjectForCacheAliasing = false;
180181
return true;
181182
}
182183

@@ -203,6 +204,15 @@ class IAsset : virtual public core::IReferenceCounted
203204

204205
virtual bool canBeRestoredFrom(const IAsset* _other) const = 0;
205206

207+
// returns if `this` is dummy or any of its dependencies up to `_levelsBelow` levels below
208+
bool isAnyDependencyDummy(uint32_t _levelsBelow = ~0u) const
209+
{
210+
if (isADummyObjectForCache())
211+
return true;
212+
213+
return _levelsBelow ? isAnyDependencyDummy_impl(_levelsBelow) : false;
214+
}
215+
206216
protected:
207217
inline static void restoreFromDummy_impl_call(IAsset* _this_child, IAsset* _other_child, uint32_t _levelsBelow)
208218
{
@@ -211,6 +221,9 @@ class IAsset : virtual public core::IReferenceCounted
211221

212222
virtual void restoreFromDummy_impl(IAsset* _other, uint32_t _levelsBelow) = 0;
213223

224+
// returns if any of `this`'s up to `_levelsBelow` levels below is dummy
225+
virtual bool isAnyDependencyDummy_impl(uint32_t _levelsBelow) const { return false; }
226+
214227
inline void clone_common(IAsset* _clone) const
215228
{
216229
assert(!isDummyObjectForCacheAliasing);

0 commit comments

Comments
 (0)