23 :
SLScene(
"GLTF File Demo Scene"),
26 info(
"GLTF File Format Test Scene");
34 "GLTF/glTF-Sample-Models/hdris/envmap_malibu.hdr",
40 _modelFile =
"GLTF/glTF-Sample-Models/2.0/DamagedHelmet/glTF/DamagedHelmet.gltf";
41 this->
name(
"glTF-Sample-Model: Damaged Helmet");
44 _modelFile =
"GLTF/glTF-Sample-Models/2.0/FlightHelmet/glTF/FlightHelmet.gltf";
45 this->
name(
"glTF-Sample-Model: Flight Helmet");
48 _modelFile =
"GLTF/glTF-Sample-Models/2.0/Sponza/glTF/Sponza.gltf";
49 this->
name(
"glTF-Sample-Model: Sponza Palace in Dubrovnic");
52 _modelFile =
"GLTF/glTF-Sample-Models/2.0/WaterBottle/glTF/WaterBottle.gltf";
53 this->
name(
"glTF-Sample-Model: WaterBottle");
72 lookAt.
set(0, camPos.
y, 0);
78 camPos.
set(0, 0.33f, 1.1f);
79 lookAt.
set(0, camPos.
y, 0);
85 camPos.
set(-8, 1.6f, 0);
86 lookAt.
set(0, camPos.
y, 0);
91 camPos.
set(0, 0, 0.5f);
92 lookAt.
set(0, camPos.
y, 0);
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
Definition of scene IDs in the demo app.
int SLSceneID
Scene identifier.
SLScene SLSceneView SLint sceneID
SLVec4< SLfloat > SLCol4f
static SLstring modelPath
Path to 3D models.
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
AppDemoSceneGLTF(SLSceneID sceneID)
void addSkyboxToLoad(SLSkybox *&skybox, const SLstring &path, SLVec2i resolution, SLstring name)
Add skybox with HDR texture to load.
SLstring modelPath() const
void addNodeToLoad(SLNode *&node, const SLstring &modelPath, SLSkybox *skybox=nullptr, SLbool deleteTexImgAfterBuild=false, SLbool loadMeshesOnly=true, SLMaterial *overrideMat=nullptr, float ambientFactor=0.5f, SLbool forceCookTorranceRM=false, SLuint flags=SLProcess_Triangulate|SLProcess_JoinIdenticalVertices|SLProcess_RemoveRedundantMaterials|SLProcess_FindDegenerates|SLProcess_FindInvalidData|SLProcess_SplitLargeMeshes)
Add mesh from file to load via assimp loader.
Toplevel holder of the assets meshes, materials, textures and shaders.
void colors(const SLCol4f &uniformColor)
Sets a uniform background color.
Active or visible camera node class.
void clipFar(const SLfloat cFar)
void focalDist(const SLfloat f)
SLBackground & background()
SLLightDirect class for a directional light source.
void createShadowMapAutoSize(SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=4) override
static SLfloat gamma
final output gamma value
void createsShadows(SLbool createsShadows)
void shadowMaxBias(SLfloat maxBias)
void shadowMap(SLShadowMap *shadowMap)
void doSmoothShadows(SLbool doSS)
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
void shadowMinBias(SLfloat minBias)
Defines a standard CG material with textures and a shader program.
void skybox(SLSkybox *sb)
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void castsShadows(SLbool castsShadows)
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void updateMeshMat(std::function< void(SLMaterial *m)> setMat, bool recursive)
Updates the mesh material recursively with a material lambda.
const SLstring & name() const
The SLScene class represents the top level instance holding the scene structure.
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)
void doWaitOnIdle(SLbool doWI)
void set(const T X, const T Y, const T Z)