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.*/
30
class
AppDemoScenePTMuttenzerBox2
:
public
SLScene
31
{
32
public
:
33
AppDemoScenePTMuttenzerBox2
();
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
:
55
SLGLTexture
*
_tex1
;
56
SLGLProgram
*
_spRefl
;
57
SLGLProgram
*
_spRefr
;
58
};
59
//-----------------------------------------------------------------------------
60
61
#endif
SLScene.h
AppDemoScenePTMuttenzerBox2
Class for the Muttenzer Box path tracing scene with soft gloss materials.
Definition:
AppDemoScenePTMuttenzerBox2.h:31
AppDemoScenePTMuttenzerBox2::AppDemoScenePTMuttenzerBox2
AppDemoScenePTMuttenzerBox2()
Definition:
AppDemoScenePTMuttenzerBox2.cpp:21
AppDemoScenePTMuttenzerBox2::assemble
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
Definition:
AppDemoScenePTMuttenzerBox2.cpp:52
AppDemoScenePTMuttenzerBox2::registerAssetsToLoad
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
Definition:
AppDemoScenePTMuttenzerBox2.cpp:33
AppDemoScenePTMuttenzerBox2::_spRefl
SLGLProgram * _spRefl
Definition:
AppDemoScenePTMuttenzerBox2.h:56
AppDemoScenePTMuttenzerBox2::_tex1
SLGLTexture * _tex1
Definition:
AppDemoScenePTMuttenzerBox2.h:55
AppDemoScenePTMuttenzerBox2::_spRefr
SLGLProgram * _spRefr
Definition:
AppDemoScenePTMuttenzerBox2.h:57
SLAssetLoader
Definition:
SLAssetLoader.h:45
SLAssetManager
Toplevel holder of the assets meshes, materials, textures and shaders.
Definition:
SLAssetManager.h:33
SLGLProgram
Encapsulation of an OpenGL shader program object.
Definition:
SLGLProgram.h:56
SLGLTexture
Texture object for OpenGL texturing.
Definition:
SLGLTexture.h:110
SLScene
The SLScene class represents the top level instance holding the scene structure.
Definition:
SLScene.h:47
SLSceneView
SceneView class represents a dynamic real time 3D view onto the scene.
Definition:
SLSceneView.h:69
apps
app_demo
source
scenes
AppDemoScenePTMuttenzerBox2.h
Generated by
1.9.1