SLProject
4.2.000
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
AppDemoSceneShaderBlinn.h
Go to the documentation of this file.
1
/**
2
* \file AppDemoSceneShaderBlinn.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 May 2024
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 APPDEMOSCENESHADERBLINN_H
14
#define APPDEMOSCENESHADERBLINN_H
15
16
#include <
SLScene.h
>
17
18
//-----------------------------------------------------------------------------
19
//! Class for demo scene with Blinn-Phong lighting per vertex or per pixel
20
class
AppDemoSceneShaderBlinn
:
public
SLScene
21
{
22
public
:
23
AppDemoSceneShaderBlinn
(
SLstring
name
,
24
bool
perVertex);
25
26
27
//! All scene specific assets have to be registered for async loading in here.
28
/*! @remark All scene sspecific assets have to be loaded async by overriding
29
SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
30
assembling means that it happens in a parallel thread and that in there are
31
no OpenGL calls allowed. OpenGL calls are only allowed in the main thread.*/
32
void
registerAssetsToLoad
(
SLAssetLoader
& al)
override
;
33
34
//! After parallel loading of the assets the scene gets assembled in here.
35
/*! @remark All scene-specific assets have to be loaded async by overriding
36
SLScene::registerAssetsToLoad and SLScene::assemble. Async loading and
37
assembling means that it happens in a parallel thread and that in there
38
are no OpenGL calls allowed. OpenGL calls are only allowed in the main
39
thread. It is important that all object instantiations within
40
SLScene::assemble do NOT call any OpenGL functions (gl*) because they happen
41
in a parallel thread. All objects that get rendered have to do their
42
initialization when they are used the first time during rendering in the
43
main thread.*/
44
void
assemble
(
SLAssetManager
* am,
SLSceneView
*
sv
)
override
;
45
46
private
:
47
bool
_perVertex
;
48
SLGLProgram
*
_perVrtTm
=
nullptr
;
49
SLGLProgram
*
_perVrt
=
nullptr
;
50
SLGLProgram
*
_perPix
=
nullptr
;
51
SLGLTexture
*
_texC
=
nullptr
;
52
SLGLTexture
*
_texN
=
nullptr
;
53
SLGLTexture
*
_texH
=
nullptr
;
54
};
55
//-----------------------------------------------------------------------------
56
57
#endif
SLstring
string SLstring
Definition:
SL.h:158
SLScene.h
AppDemoSceneShaderBlinn
Class for demo scene with Blinn-Phong lighting per vertex or per pixel.
Definition:
AppDemoSceneShaderBlinn.h:21
AppDemoSceneShaderBlinn::_texC
SLGLTexture * _texC
Definition:
AppDemoSceneShaderBlinn.h:51
AppDemoSceneShaderBlinn::AppDemoSceneShaderBlinn
AppDemoSceneShaderBlinn(SLstring name, bool perVertex)
Definition:
AppDemoSceneShaderBlinn.cpp:21
AppDemoSceneShaderBlinn::_perVrt
SLGLProgram * _perVrt
Definition:
AppDemoSceneShaderBlinn.h:49
AppDemoSceneShaderBlinn::_texN
SLGLTexture * _texN
Definition:
AppDemoSceneShaderBlinn.h:52
AppDemoSceneShaderBlinn::_perPix
SLGLProgram * _perPix
Definition:
AppDemoSceneShaderBlinn.h:50
AppDemoSceneShaderBlinn::registerAssetsToLoad
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
Definition:
AppDemoSceneShaderBlinn.cpp:41
AppDemoSceneShaderBlinn::_texH
SLGLTexture * _texH
Definition:
AppDemoSceneShaderBlinn.h:53
AppDemoSceneShaderBlinn::_perVrtTm
SLGLProgram * _perVrtTm
Definition:
AppDemoSceneShaderBlinn.h:48
AppDemoSceneShaderBlinn::assemble
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
Definition:
AppDemoSceneShaderBlinn.cpp:64
AppDemoSceneShaderBlinn::_perVertex
bool _perVertex
Definition:
AppDemoSceneShaderBlinn.h:47
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
SLObject::name
const SLstring & name() const
Definition:
SLObject.h:38
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
AppDemoSceneShaderBlinn.h
Generated by
1.9.1