SLProject  4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppDemoScenePTMuttenzerBox2.h
Go to the documentation of this file.
1 /**
2  * \file AppDemoScenePTMuttenzerBox2.h
3  * \brief Class declaration for an SLScene inherited class
4  * \details For more info about App framework and the scene assembly see:
5  * https://cpvrlab.github.io/SLProject4/app-framework.html
6  * \date September 2025
7  * \authors Marcus Hudritsch, Marino von Wattenwyl
8  * \copyright http://opensource.org/licenses/GPL-3.0
9  * \remarks Please use clangformat to format the code. See more code style on
10  * https://github.com/cpvrlab/SLProject4/wiki/SLProject-Coding-Style
11  */
12 
13 #ifndef APPDEMOSCENEPTMUTTENZERBOX2_H
14 #define APPDEMOSCENEPTMUTTENZERBOX2_H
15 
16 #include <SLScene.h>
17 
18 //-----------------------------------------------------------------------------
19 //! Class for the Muttenzer Box path tracing scene with soft gloss materials
20 /*! The same box and the same two spheres as AppDemoScenePTMuttenzerBox, with
21 one difference: the shininess of the mirror sphere and both the translucency
22 and the shininess of the glass sphere are 100 instead of SLMaterial::PERFECT
23 (1000). Below that limit the path tracer draws the direction from the Phong
24 lobe of the exponent (SLRay::reflectMC and SLRay::refractMC) instead of taking
25 the perfect specular one, so the mirror sphere reflects blurred and the glass
26 sphere is frosted in its refraction as well as in its surface reflection. The
27 glass sphere is also given a red transmissive color, which makes its caustic on
28 the floor red. Only the path tracer shows any of this; the OpenGL preview and
29 the ray tracer render the scene exactly like the original.*/
31 {
32 public:
34 
35  //! All scene specific assets have to be registered for async loading in here.
36  /*! @remark All scene sspecific assets have to be loaded async by overriding
37  SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
38  assembling means that it happens in a parallel thread and that in there are
39  no OpenGL calls allowed. OpenGL calls are only allowed in the main thread.*/
40  void registerAssetsToLoad(SLAssetLoader& al) override;
41 
42  //! After parallel loading of the assets the scene gets assembled in here.
43  /*! @remark All scene-specific assets have to be loaded async by overriding
44  SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
45  assembling means that it happens in a parallel thread and that in there
46  are no OpenGL calls allowed. OpenGL calls are only allowed in the main
47  thread. It is important that all object instantiations within
48  SLScene::assemble do NOT call any OpenGL functions (gl*) because they happen
49  in a parallel thread. All objects that get rendered have to do their
50  initialization when they are used the first time during rendering in the
51  main thread.*/
52  void assemble(SLAssetManager* am, SLSceneView* sv) override;
53 
54 private:
58 };
59 //-----------------------------------------------------------------------------
60 
61 #endif
Class for the Muttenzer Box path tracing scene with soft gloss materials.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
Toplevel holder of the assets meshes, materials, textures and shaders.
Encapsulation of an OpenGL shader program object.
Definition: SLGLProgram.h:56
Texture object for OpenGL texturing.
Definition: SLGLTexture.h:110
The SLScene class represents the top level instance holding the scene structure.
Definition: SLScene.h:47
SceneView class represents a dynamic real time 3D view onto the scene.
Definition: SLSceneView.h:69