From 2ea01daf4b88a915b34935aa610be8650d633e0f Mon Sep 17 00:00:00 2001 From: TheRedShip Date: Fri, 31 Jan 2025 17:18:17 +0100 Subject: [PATCH] ~ | minor change --- imgui.ini | 16 +++++++++++----- scenes/lambo.rt | 25 +++++++++++++++++++++++++ scenes/sponza.rt | 6 +++--- scenes/test.rt | 12 ++++++++---- srcs/class/ObjParser.cpp | 4 +--- 5 files changed, 48 insertions(+), 15 deletions(-) create mode 100644 scenes/lambo.rt diff --git a/imgui.ini b/imgui.ini index 877c234..6319185 100644 --- a/imgui.ini +++ b/imgui.ini @@ -3,26 +3,32 @@ Pos=60,60 Size=400,400 [Window][Camera] -Pos=1645,8 +Pos=1617,8 Size=259,200 [Window][Material] -Pos=1633,205 +Pos=1594,206 Size=262,299 [Window][Fog settings] -Pos=1647,517 +Pos=1632,514 Size=247,130 +Collapsed=1 [Window][Debug] Pos=1642,668 Size=260,143 [Window][Debug BVH] -Pos=1644,648 +Pos=1628,542 Size=274,131 +Collapsed=1 [Window][Renderer] -Pos=374,0 +Pos=1556,610 Size=284,382 +[Window][Settings] +Pos=1595,22 +Size=259,975 + diff --git a/scenes/lambo.rt b/scenes/lambo.rt new file mode 100644 index 0000000..3bc0817 --- /dev/null +++ b/scenes/lambo.rt @@ -0,0 +1,25 @@ +CAM -2.41462 2.57199 4.09049 -1.80012 -50.2012 0.02 2.973 45.75 5 + +MAT 20 20 20 0. 0.9 0.5 // 0 gray +# pl 0 5.2 0 0 -1 0 0 // floor +qu -5 5 -5 10 0 0 0 0 10 0 + + +MAT 255 100 100 1.0 0.0 0.0 //1 red +MAT 100 100 255 1.0 0.0 0.0 //2 blue + +po -0.75 1.5 5 0 1.5 0 1.5 0 0 1 2 +po -0.75 10 2.4 0 1.5 0 1.5 0 0 1 1 + + +MAT 200 200 200 0. 0. 0. // 3 white +MAT 255 255 255 1. 0. 0. // 4 light + +cu 0 10 0 5 5 5 3 +sp 0 10 0 1 4 + + +OBJ obj/lambo.obj 0 1.5 0 1 0 0 0 + + + diff --git a/scenes/sponza.rt b/scenes/sponza.rt index 87b4e93..df08f4d 100644 --- a/scenes/sponza.rt +++ b/scenes/sponza.rt @@ -7,8 +7,8 @@ MAT 255 220 50 0.0 1.0 0.5 // dragon 1 MAT 255 255 255 5.0 0.0 0.0 // light 2 sp 0 50 0 25 2 -OBJ scenes/obj/sponza.obj 0 0 0 0.025 +OBJ obj/sponza.obj 0 0 0 0.025 -OBJ scenes/obj/Dragon_80K.obj 7 2.5 0 9 0 140 0 0 -OBJ scenes/obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1 +OBJ obj/Dragon_80K.obj 7 2.5 0 9 0 140 0 0 +OBJ obj/Dragon_80K.obj 9 1.35 -3.5 5 0 40 0 1 diff --git a/scenes/test.rt b/scenes/test.rt index d5a498c..c9d32ef 100644 --- a/scenes/test.rt +++ b/scenes/test.rt @@ -1,7 +1,11 @@ CAM -2.41462 2.57199 4.09049 -1.80012 -50.2012 0.02 2.973 45.75 5 -MAT 20 20 20 0. 0. 0. // 0 gray -pl 0 5.2 0 0 -1 0 0 // floor +MAT 20 20 20 0. 0.9 0.5 // 0 gray +# pl 0 -0.5 0 0 -1 0 0 // floor -OBJ scenes/obj/lambo.obj 0 1.5 0 1 0 0 0 -# OBJ obj/sponza.obj 0 5 0 0.01 + +MAT 0 0 0 0. 0 0 // 1 black +MAT 255 255 255 0. 1.5 0 DIE -1 // 2 blackhole + +sp 0 0 0 5 1 +sp 0 0 0 15 2 diff --git a/srcs/class/ObjParser.cpp b/srcs/class/ObjParser.cpp index 3b3b487..022d998 100644 --- a/srcs/class/ObjParser.cpp +++ b/srcs/class/ObjParser.cpp @@ -284,9 +284,7 @@ void ObjParser::parseMtl(std::stringstream &input_line, Scene &scene) float x, y, z; if(!(lineStream >> x >> y >> z)) throw std::runtime_error("OBJ: syntax error while getting material emission"); - mat->emission = (x + y + z); - // if (mat->emission > 0.0) - // mat->color = glm::vec3(x, y, z); + mat->emission = (x + y + z) / 3; } else if(identifier == "Ni") {