Skip to content

Commit 2806020

Browse files
committed
Resolved conflicts
2 parents be58804 + 75009e8 commit 2806020

File tree

82 files changed

+2033
-1981
lines changed

Some content is hidden

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

82 files changed

+2033
-1981
lines changed

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: 4 additions & 4 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)
@@ -92,7 +92,7 @@ int main()
9292

9393
size_t neededDS1UBOsz = 0ull;
9494
{
95-
for (const auto& shdrIn : pipelineMetadata->getRequiredShaderInputs())
95+
for (const auto& shdrIn : pipelineMetadata->m_inputSemantics)
9696
if (shdrIn.descriptorSection.type==asset::IRenderpassIndependentPipelineMetadata::ShaderInput::ET_UNIFORM_BUFFER && shdrIn.descriptorSection.uniformBufferObject.set==1u && shdrIn.descriptorSection.uniformBufferObject.binding==ds1UboBinding)
9797
neededDS1UBOsz = std::max<size_t>(neededDS1UBOsz, shdrIn.descriptorSection.uniformBufferObject.relByteoffset+shdrIn.descriptorSection.uniformBufferObject.bytesize);
9898
}
@@ -140,7 +140,7 @@ int main()
140140
camera->render();
141141

142142
core::vector<uint8_t> uboData(gpuubo->getSize());
143-
for (const auto& shdrIn : pipelineMetadata->getRequiredShaderInputs())
143+
for (const auto& shdrIn : pipelineMetadata->m_inputSemantics)
144144
{
145145
if (shdrIn.descriptorSection.type==asset::IRenderpassIndependentPipelineMetadata::ShaderInput::ET_UNIFORM_BUFFER && shdrIn.descriptorSection.uniformBufferObject.set==1u && shdrIn.descriptorSection.uniformBufferObject.binding==ds1UboBinding)
146146
{

examples_tests/18.MitsubaLoader/main.cpp

Lines changed: 25 additions & 36 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
@@ -382,17 +382,17 @@ int main()
382382
ds1UboBinding = bnd.binding;
383383
break;
384384
}
385+
<<<<<<< HEAD
385386

387+
=======
388+
>>>>>>> 75009e87e87f56642a522ec643c4d394bf3e21d8
386389

390+
//scene bound
391+
core::aabbox3df sceneBound(FLT_MAX,FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX,-FLT_MAX);
387392
//point lights
388393
core::vector<SLight> lights;
389-
core::vector<const ext::MitsubaLoader::IMeshMetadata*> meshmetas;
390-
meshmetas.reserve(cpumeshes.size());
391394
for (const auto& cpumesh : cpumeshes)
392395
{
393-
meshmetas.push_back(static_cast<const ext::MitsubaLoader::IMeshMetadata*>(cpumesh->getMetadata()));
394-
const auto& instances = meshmetas.back()->getInstances();
395-
396396
auto computeAreaAndAvgPos = [](const asset::ICPUMeshBuffer* mb, const core::matrix3x4SIMD& tform, core::vectorSIMDf& _outAvgPos) {
397397
uint32_t triCount = 0u;
398398
asset::IMeshManipulator::getPolyCount(triCount, mb);
@@ -422,22 +422,27 @@ int main()
422422

423423
return 0.5f*core::length(differentialElementCrossProdcut).x;
424424
};
425-
for (const auto& inst : instances)
425+
426+
const auto* mesh_meta = globalMeta->getAssetSpecificMetadata(cpumesh.get());
427+
auto auxInstanceDataIt = mesh_meta->m_instanceAuxData.begin();
428+
for (const auto& inst : mesh_meta->m_instances)
426429
{
427-
if (inst.emitter.type==ext::MitsubaLoader::CElementEmitter::AREA)
430+
sceneBound.addInternalBox(core::transformBoxEx(cpumesh->getBoundingBox(),inst.worldTform));
431+
if (auxInstanceDataIt->frontEmitter.type==ext::MitsubaLoader::CElementEmitter::AREA)
428432
{
429433
core::vectorSIMDf pos;
430434
assert(cpumesh->getMeshBuffers().size()==1u);
431-
const float area = computeAreaAndAvgPos(cpumesh->getMeshBuffers().begin()[0], inst.tform, pos);
435+
const float area = computeAreaAndAvgPos(cpumesh->getMeshBuffers().begin()[0], inst.worldTform, pos);
432436
assert(area>0.f);
433-
inst.tform.pseudoMulWith4x1(pos);
437+
inst.worldTform.pseudoMulWith4x1(pos);
434438

435439
SLight l;
436-
l.intensity = inst.emitter.area.radiance*area*2.f*core::PI<float>();
440+
l.intensity = auxInstanceDataIt->frontEmitter.area.radiance*area*2.f*core::PI<float>();
437441
l.position = pos;
438442

439443
lights.push_back(l);
440444
}
445+
auxInstanceDataIt++;
441446
}
442447
}
443448

@@ -482,26 +487,10 @@ int main()
482487
}
483488
modifiedShaders.clear();
484489

485-
core::aabbox3df sceneBound;
486-
auto gpumeshes = driver->getGPUObjectsFromAssets(cpumeshes.data(), cpumeshes.data()+cpumeshes.size());
487-
{
488-
auto metait = meshmetas.begin();
489-
for (auto gpuit = gpumeshes->begin(); gpuit != gpumeshes->end(); gpuit++, metait++)
490-
{
491-
auto* meta = *metait;
492-
const auto* meshmeta = static_cast<const ext::MitsubaLoader::IMeshMetadata*>(meta);
493-
const auto& instances = meshmeta->getInstances();
494490

495-
auto bb = (*gpuit)->getBoundingBox();
496-
for (const auto& inst : instances)
497-
{
498-
sceneBound.addInternalBox(core::transformBoxEx(bb, inst.tform));
499-
}
500-
}
501-
}
491+
auto gpumeshes = driver->getGPUObjectsFromAssets(cpumeshes.data(), cpumeshes.data()+cpumeshes.size());
502492

503493
auto gpuds0 = driver->getGPUObjectsFromAssets(&cpuds0.get(), &cpuds0.get()+1)->front();
504-
505494
auto gpuds1layout = driver->getGPUObjectsFromAssets(&ds1layout, &ds1layout+1)->front();
506495

507496
auto gpuubo = driver->createDeviceLocalGPUBufferOnDedMem(sizeof(asset::SBasicViewParameters));

examples_tests/20.Megatexture/main.cpp

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

447447
size_t neededDS1UBOsz = 0ull;
448448
{
449-
for (const auto& shdrIn : pipelineMetadata->getRequiredShaderInputs())
449+
for (const auto& shdrIn : pipelineMetadata->m_inputSemantics)
450450
if (shdrIn.descriptorSection.type==asset::IRenderpassIndependentPipelineMetadata::ShaderInput::ET_UNIFORM_BUFFER && shdrIn.descriptorSection.uniformBufferObject.set==1u && shdrIn.descriptorSection.uniformBufferObject.binding==ds1UboBinding)
451451
neededDS1UBOsz = std::max<size_t>(neededDS1UBOsz, shdrIn.descriptorSection.uniformBufferObject.relByteoffset+shdrIn.descriptorSection.uniformBufferObject.bytesize);
452452
}
@@ -518,7 +518,7 @@ int main()
518518
camera->render();
519519

520520
core::vector<uint8_t> uboData(gpuubo->getSize());
521-
for (const auto& shdrIn : pipelineMetadata->getRequiredShaderInputs())
521+
for (const auto& shdrIn : pipelineMetadata->m_inputSemantics)
522522
{
523523
if (shdrIn.descriptorSection.type==asset::IRenderpassIndependentPipelineMetadata::ShaderInput::ET_UNIFORM_BUFFER && shdrIn.descriptorSection.uniformBufferObject.set==1u && shdrIn.descriptorSection.uniformBufferObject.binding==ds1UboBinding)
524524
{

examples_tests/21.DynamicTextureIndexing/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,19 @@ 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");
5757

5858
asset::IAssetLoader::SAssetLoadParams lp;
5959
auto meshes_bundle = am->getAsset("sponza.obj", lp);
60-
assert(!meshes_bundle.isEmpty());
60+
assert(!meshes_bundle.getContents().empty());
6161
auto mesh = meshes_bundle.getContents().begin()[0];
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

0 commit comments

Comments
 (0)