23 :
SLScene(
"Shadow Mapping for point lights")
25 info(
"Point lights use cubemaps to store shadow maps.");
56 for (
SLint i = 0; i < 3; ++i)
62 SLCol4f(i == 0, i == 1, i == 2));
64 light->
translate((
float)i - 1.0f, (
float)i - 1.0f, (
float)i - 1.0f);
77 SLfloat pL = -1.48f, pR = 1.48f;
78 SLfloat pB = -1.25f, pT = 1.19f;
79 SLfloat pN = 1.79f, pF = -1.55f;
152 for (
SLint i = 0; i < 64; ++i)
155 box->
mat(matPerPixSM);
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
SLVec2< SLfloat > SLVec2f
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
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.
AppDemoSceneShadowLightPoint()
SLAnimation * createNodeAnimation(SLfloat duration)
SLAnimation is the base container for all animation data.
SLNodeAnimTrack * createNodeAnimTrackForEllipse(SLNode *target, SLfloat radiusA, SLAxis axisA, SLfloat radiusB, SLAxis axisB)
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 devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
void fov(const SLfloat fov)
vertical field of view
void createsShadows(SLbool createsShadows)
void shadowMap(SLShadowMap *shadowMap)
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.
SLLightSpot class for a spot light source.
void createShadowMap(float lightClipNear=0.1f, float lightClipFar=20.0f, SLVec2f size=SLVec2f(8, 8), SLVec2i texSize=SLVec2i(1024, 1024)) override
Defines a standard CG material with textures and a shader program.
SLNode represents a node in a hierarchical scene graph.
void addChild(SLNode *child)
void translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
void castsShadows(SLbool castsShadows)
SLVec3f translationOS() 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)
SLRectangle creates a rectangular mesh with a certain resolution.
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)
float random(float min, float max)
Returns a uniform distributed random float number between min and max.