Simple GPU Path Tracing, Part 6 : GUI
- Simple GPU Path Tracing : Introduction
- Simple GPU Path Tracing, Part. 1 : Project Setup
- Simple GPU Path Tracing, Part. 1.1 : Adding a cuda backend to the project
- Simple GPU Path Tracing, Part. 2.0 : Scene Representation
- Simple GPU Path Tracing, Part. 2.1 : Acceleration structure
- Simple GPU Path Tracing, Part. 3.0 : Path Tracing Basics
- Simple GPU Path Tracing, Part. 3.1 : Matte Material
- Simple GPU Path Tracing, Part. 3.2 : Physically Based Material
- Simple GPU Path Tracing, Part. 3.4 : Small Improvements, Camera and wrap up
- Simple GPU Path Tracing, Part. 4.0 : Mesh Loading
- Simple GPU Path Tracing, Part. 4.1 : Textures
- Simple GPU Path Tracing, Part. 4.2 : Normal Mapping & GLTF Textures
- Simple GPU Path Tracing, Part. 5.0 : Sampling lights
- Simple GPU Path Tracing, Part 6 : GUI
- Simple GPU Path Tracing, Part 7.0 : Transparency
- Simple GPU Path Tracing, Part 7.1 : Volumetric materials
- Simple GPU Path Tracing, Part 7.2 : Refractive material
- Simple GPU Path Tracing, Part 8 : Denoising
- Simple GPU Path Tracing, Part 9 : Environment Lighting
- Simple GPU Path Tracing, Part 10 : Little Optimizations
- Simple GPU Path Tracing, Part 11 : Multiple Importance Sampling
As we progress in our implementation, it can become useful to be able to tweak some parameters on the fly, rather than having to compile the whole thing everytime we want to change something.
That's why it's time to implement a super simple GUI, using dearimgui.
Here's the commit for this post
It's all going to be super basic, so I'm not going to go into too much details, but will just show how it works.
I created a gui class that will implement all the user interface stuff. I added it as a member of application, and we call
in the main loop function.
the way it works is we have a left panel with all the gui, and the main rendered image on the right.
on the left panel are multiple tabs that will allow to manage multiple aspects of the app :
- Instances
- Materials
- Shapes
- Cameras
- Textures
- Tracing parameters
Not all the interfaces are fully implemented yet, and we will improve the gui as we go.
But at least, this will allow to move objects around in the scene, to change material properties and path tracing properties, all of that on the fly, which is going to be quite helpful !
Here's the core of the Gui() function :
Each tab has its own function, this is very basic imgui code so I won't show all the details, and it's not so interesting anyway.
Next Post : Simple GPU Path Tracing, Part 7.0 : Transparency
Commentaires
Enregistrer un commentaire