22 :
SLScene(
"Level of Detail Test"),
32 "GLTF/CorinthianColumn/PavementSlateSquare2_2K_DIF.jpg",
36 "GLTF/CorinthianColumn/PavementSlateSquare2_2K_NRM.jpg",
40 "GLTF/CorinthianColumn/Corinthian-Column-Round-LOD.gltf");
53 "%d corinthian columns without LOD",
62 "%d corinthian columns with LOD",
66 info(this->
name() +
" with cascaded shadow mapping. In the Day-Time dialogue you can change the sun angle.");
85 sunLight->
powers(0.25f, 1.0f, 1.0f);
88 sunLight->
lookAt(-1, 0, -1);
118 rect->
rotate(90, -1, 0, 0);
130 scene->addChild(sunLight);
131 scene->addChild(rect);
132 scene->addChild(cam1);
135 SLint numColumns = size * size;
137 SLfloat z = (float)(size - 1) * offset * 0.5f;
139 for (
SLint iZ = 0; iZ < size; ++iZ)
141 SLfloat x = -(float)(size - 1) * offset * 0.5f;
143 for (
SLint iX = 0; iX < size; ++iX)
145 SLint iZX = iZ * size + iX;
150 string strNode =
"Node" + std::to_string(iZX);
154 scene->addChild(column);
159 string strLOD =
"LOD" + std::to_string(iZX);
174 scene->addChild(lod_group);
The AppCommon class holds the top-level instances of the app-demo.
Definition of scene IDs in the demo app.
@ SID_Benchmark_ColumnsNoLOD
Class declaration for an SLScene inherited class.
int SLSceneID
Scene identifier.
#define SL_ANISOTROPY_MAX
SLScene SLSceneView SLint sceneID
SLVec2< SLfloat > SLVec2f
SLVec4< SLfloat > SLCol4f
static SLDeviceLocation devLoc
Mobile device location from GPS.
static SLstring modelPath
Path to 3D models.
SLGLTexture * _texFloorDif
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.
SLGLTexture * _texFloorNrm
AppDemoSceneLevelOfDetail(SLSceneID sceneID)
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.
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()
void defaultLatLonAlt(int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM)
Default coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
void originLatLonAlt(int degreesLat, int minutesLat, double secondsLat, int degreesLon, int minutesLon, double secondsLon, double altitudeM)
Origin coordinate setter in WGS84 Lat-Lon in degrees, minutes and seconds.
void sunLightNode(SLLightDirect *sln)
SLLightDirect class for a directional light source.
void doSunPowerAdaptation(SLbool enabled)
void createShadowMapAutoSize(SLCamera *camera, SLVec2i texSize=SLVec2i(1024, 1024), int numCascades=4) override
void createsShadows(SLbool createsShadows)
void shadowMaxBias(SLfloat maxBias)
void doSmoothShadows(SLbool doSS)
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.
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 translation(const SLVec3f &pos, SLTransformSpace relativeTo=TS_parent)
void rotate(const SLQuat4f &rot, SLTransformSpace relativeTo=TS_object)
void castsShadows(SLbool castsShadows)
T * findChild(const SLstring &name="", SLbool findRecursive=true)
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)
Level of detail (LOD) group node based on screen space coverage.
void addChildLOD(SLNode *child, SLfloat minLodLimit, SLubyte levelForSM=0)
Adds an LOD node with forced decreasing min LOD coverage.
const SLstring & name() const
SLRectangle creates a rectangular mesh with a certain resolution.
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)