22 :
SLScene(
"Image Based Lighting Test Scene")
24 info(
"Image-based lighting from skybox using high dynamic range images. "
25 "It uses the Cook-Torrance reflection model also to calculate the "
26 "ambient light part from the surrounding HDR skybox.");
34 "gold-scuffed_2048_C.png");
37 "gold-scuffed_2048_N.png");
40 "gold-scuffed_2048_M.png");
43 "gold-scuffed_2048_R.png");
46 "gold-scuffed_2048_A.png");
85 light1->
shadowMap()->cascadesFactor(30.0);
93 const SLint nrRows = 7;
94 const SLint nrCols = 7;
96 SLfloat maxX = (float)((
int)(nrCols / 2) * spacing);
97 SLfloat maxY = (float)((
int)(nrRows / 2) * spacing);
98 SLfloat deltaR = 1.0f / (float)(nrRows - 1);
99 SLfloat deltaM = 1.0f / (float)(nrCols - 1);
104 for (
SLint m = 0; m < nrRows; ++m)
107 for (
SLint r = 0; r < nrCols; ++r)
109 if (m == nrRows / 2 && r == nrCols / 2)
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
SLVec4< SLfloat > SLCol4f
static SLstring texturePath
Path to texture images.
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.
SLstring texturePath() const
void addSkyboxToLoad(SLSkybox *&skybox, const SLstring &path, SLVec2i resolution, SLstring name)
Add skybox with HDR texture to load.
void addTextureToLoad(SLGLTexture *&texture, const SLstring &path, SLint min_filter=GL_LINEAR_MIPMAP_LINEAR, SLint mag_filter=GL_LINEAR, SLTextureType type=TT_unknown, SLint wrapS=GL_REPEAT, SLint wrapT=GL_REPEAT)
Add 2D textures with internal image allocation.
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.
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.
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 translate(const SLVec3f &vec, SLTransformSpace relativeTo=TS_object)
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)
SLSphere creates a sphere mesh based on SLRevolver.
T clamp(T a, T min, T max)