Skip to content

Commit 443a9a3

Browse files
committed
update Readme
1 parent ed40538 commit 443a9a3

File tree

6 files changed

+50
-14
lines changed

6 files changed

+50
-14
lines changed

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,39 @@ Visualizer:
5959
| ------------------------------- | ----------------------------- | --------------------------- |
6060
| 5117 triangles | 2,349,078 triangles | 6,490,766 triangles |
6161
| ![](results/BVH/BVH.png) | ![](results/BVH/DragonBVH.png) | ![](results/BVH/CoverBVH.png) |
62+
63+
# Disney BRDF Model
64+
65+
This is a robust and art-oriented material model that allows for interpolation between different types of material based on pbr parameters. The model implemented in this project referenced SIGGRAPH 2012 [Physically Based Shading at Disney](https://media.disneyanimation.com/uploads/production/publication_asset/48/asset/s2012_pbs_disney_brdf_notes_v3.pdf) by Disney and their public repo [brdf](https://github.com/wdas/brdf/tree/main)
66+
![](results/DisneyBRDF/presentation.png)
67+
68+
The input parameters are given by:
69+
70+
color baseColor .82 .67 .16
71+
float metallic 0 1 0
72+
float subsurface 0 1 0
73+
float specular 0 1 .5
74+
float roughness 0 1 .5
75+
float specularTint 0 1 0
76+
float anisotropic 0 1 0
77+
float sheen 0 1 0
78+
float sheenTint 0 1 .5
79+
float clearcoat 0 1 0
80+
float clearcoatGloss 0 1 1
81+
82+
| JSON Input |
83+
| ------------------------------------- |
84+
| ![](results/DisneyBRDF/jsonInput.png) |
85+
86+
GUI allowing for dynamically changing parameters:
87+
88+
| GUI |
89+
| ------------------------------- |
90+
| ![](results/DisneyBRDF/GUI.png) |
91+
92+
A brief demo illustrates the usage:
93+
94+
<video width="834" height="469" controls>
95+
<source src="results/DisneyBRDF/DisneyBRDF.mp4" type="video/mp4">
96+
Your browser does not support the video.
97+
</video>

results/DisneyBRDF/GUI.png

6.87 KB
Loading

results/DisneyBRDF/jsonInput.png

26.3 KB
Loading
128 KB
Loading

src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ int main(int argc, char** argv)
4848

4949
const char* sceneFile = argv[1];
5050
// Load scene file
51-
scene = new Scene("D:\\Fall2024\\CIS5650\\Project3-CUDA-Path-Tracer\\scenes\\Cover.json");
51+
scene = new Scene("D:\\Fall2024\\CIS5650\\Project3-CUDA-Path-Tracer\\scenes\\DisneyBRDF.json");
5252
//scene->createBRDFDisplay();
5353
// test loading obj
5454
Material newMaterial(glm::vec3(15, 154, 255) / 255.f);

src/preview.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void RenderImGui()
252252
for (int i = 0; i < scene->materials.size(); i++) {
253253
materialKey[i] = materialIdx[i].c_str();
254254
}
255-
if (ImGui::Combo("Combo", &currentItem, materialKey, materialIdx.size())) {
255+
if (ImGui::Combo("Scene Materials", &currentItem, materialKey, materialIdx.size())) {
256256
mat = &scene->materials[currentItem];
257257
}
258258
// create label: slider value GUI
@@ -261,62 +261,62 @@ void RenderImGui()
261261
bool update = false;
262262
ImGui::Text("Material ID: %d", mat->materialId);
263263
// color
264-
ImGui::Text("Color: (%f, %f, %f)", mat->color.x, mat->color.y, mat->color.z);
264+
ImGui::Text("Color: ");
265265
ImGui::SameLine();
266266
if (ImGui::ColorEdit3("##color", (float*)&mat->color)) update = true;
267267

268268
// metallic
269-
ImGui::Text("Metallic: %f", mat->metallic);
269+
ImGui::Text("Metallic: %.2f", mat->metallic);
270270
ImGui::SameLine();
271271
if (ImGui::SliderFloat("##metallic", &mat->metallic, 0.0f, 1.0f)) update = true;
272272

273273
// subsurface
274-
ImGui::Text("Subsurface: %f", mat->subsurface);
274+
ImGui::Text("Subsurface: %.2f", mat->subsurface);
275275
ImGui::SameLine();
276276
if (ImGui::SliderFloat("##subsurface", &mat->subsurface, 0.0f, 1.0f)) update = true;
277277

278278
// specular
279-
ImGui::Text("Specular: %f", mat->specular);
279+
ImGui::Text("Specular: %.2f", mat->specular);
280280
ImGui::SameLine();
281281
if (ImGui::SliderFloat("##specular", &mat->specular, 0.0f, 1.0f)) update = true;
282282

283283
// roughness
284-
ImGui::Text("Roughness: %f", mat->roughness);
284+
ImGui::Text("Roughness: %.2f", mat->roughness);
285285
ImGui::SameLine();
286286
if (ImGui::SliderFloat("##roughness", &mat->roughness, 0.0f, 1.0f)) update = true;
287287

288288
// specularTint
289-
ImGui::Text("Specular Tint: %f", mat->specularTint);
289+
ImGui::Text("Specular Tint: %.2f", mat->specularTint);
290290
ImGui::SameLine();
291291
if (ImGui::SliderFloat("##specularTint", &mat->specularTint, 0.0f, 1.0f)) update = true;
292292

293293
// anisotropic
294-
ImGui::Text("Anisotropic: %f", mat->anisotropic);
294+
ImGui::Text("Anisotropic: %.2f", mat->anisotropic);
295295
ImGui::SameLine();
296296
if (ImGui::SliderFloat("##anisotropic", &mat->anisotropic, 0.0f, 1.0f)) update = true;
297297

298298
// sheen
299-
ImGui::Text("Sheen: %f", mat->sheen);
299+
ImGui::Text("Sheen: %.2f", mat->sheen);
300300
ImGui::SameLine();
301301
if (ImGui::SliderFloat("##sheen", &mat->sheen, 0.0f, 1.0f)) update = true;
302302

303303
// sheenTint
304-
ImGui::Text("Sheen Tint: %f", mat->sheenTint);
304+
ImGui::Text("Sheen Tint: %.2f", mat->sheenTint);
305305
ImGui::SameLine();
306306
if (ImGui::SliderFloat("##sheenTint", &mat->sheenTint, 0.0f, 1.0f)) update = true;
307307

308308
// clearcoat
309-
ImGui::Text("Clearcoat: %f", mat->clearcoat);
309+
ImGui::Text("Clearcoat: %.2f", mat->clearcoat);
310310
ImGui::SameLine();
311311
if (ImGui::SliderFloat("##clearcoat", &mat->clearcoat, 0.0f, 1.0f)) update = true;
312312

313313
// clearcoatGloss
314-
ImGui::Text("Clearcoat Gloss: %f", mat->clearcoatGloss);
314+
ImGui::Text("Clearcoat Gloss: %.2f", mat->clearcoatGloss);
315315
ImGui::SameLine();
316316
if (ImGui::SliderFloat("##clearcoatGloss", &mat->clearcoatGloss, 0.0f, 1.0f)) update = true;
317317

318318
// ior
319-
ImGui::Text("IOR: %f", mat->ior);
319+
ImGui::Text("IOR: %.2f", mat->ior);
320320
ImGui::SameLine();
321321
if (ImGui::SliderFloat("##ior", &mat->ior, 0.0f, 1.0f)) update = true;
322322

0 commit comments

Comments
 (0)