23 :
SLScene(
"Shadow Mapping Types Demo Scene")
25 info(
"Shadow Mapping is implemented for these light types.");
33 "FBX/Teapot/Teapot.fbx");
54 vector<SLLight*>
lights = {
68 light->
powers(0.0f, 0.4f, 0.4f);
73 light->
powers(0.0f, 2.0f, 2.0f);
95 teapot->
translate(light->positionWS().x, 2, 0);
96 teapot->
children()[0]->castsShadows(
true);
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
@ EC_linear
linear easing with constant velocity
SLQuat4< SLfloat > SLQuat4f
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.
AppDemoSceneShadowLightTypes()
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrack()
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 focalDist(const SLfloat f)
SLBackground & background()
SLLightDirect class for a directional light source.
Abstract Light class for OpenGL light sources.
void createsShadows(SLbool createsShadows)
void shadowMap(SLShadowMap *shadowMap)
virtual void createShadowMap(float lightClipNear=0.1f, float lightClipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024))=0
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
void powers(SLfloat ambiPow, SLfloat diffPow, SLfloat specPow, const SLCol4f &ambiDiffSpecCol=SLCol4f::WHITE)
Sets the ambient, diffuse and specular powers all with the same color.
Light node class for a rectangular light source.
SLLightSpot class for a spot light source.
Defines a standard CG material with textures and a shader program.
Specialized animation track for node animations.
void animatedNode(SLNode *target)
SLTransformKeyframe * createNodeKeyframe(SLfloat time)
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)
virtual SLNode * copyRec()
SLVec3f translationWS() const
void lookAt(SLfloat targetX, SLfloat targetY, SLfloat targetZ, SLfloat upX=0, SLfloat upY=1, SLfloat upZ=0, SLTransformSpace relativeTo=TS_world)
void translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
The SLScene class represents the top level instance holding the scene structure.
SLAnimManager & animManager()
SceneView class represents a dynamic real time 3D view onto the scene.
void camera(SLCamera *camera)