21 :
SLScene(
"Lots of Nodes Benchmark Scene")
23 info(
"Lots of Nodes Benchmark Scene");
54 light1->
powers(0.2f, 0.8f, 1.0f);
66 SLstring matName =
"mat-" + std::to_string(i);
72 mat[i]->diffuse(color);
78 for (
SLint iZ = -halfSize; iZ <= halfSize; ++iZ)
80 for (
SLint iY = -halfSize; iY <= halfSize; ++iY)
82 for (
SLint iX = -halfSize; iX <= halfSize; ++iX)
87 SLstring nodeName =
"earth-" + std::to_string(n);
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
vector< SLMaterial * > SLVMaterial
STL vector of material pointers.
SLVec4< SLfloat > SLVec4f
SLVec4< SLfloat > SLCol4f
static SLstring texturePath
Path to texture images.
SLGLTexture * _texC[_NUM_MAT]
AppDemoSceneLotsOfNodes()
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
static const int _NUM_MAT
void registerAssetsToLoad(SLAssetLoader &al) override
All scene specific assets have to be registered for async loading in here.
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 clipFar(const SLfloat cFar)
void clipNear(const SLfloat cNear)
void focalDist(const SLfloat f)
SLBackground & background()
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.
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 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 SLSpheric w. 180 deg polar angle.
void hsva2rgba(const SLVec4 &hsva)
HSVA to RGBA color conversion (http://www.rapidtables.com/convert/color/hsv-to-rgb....
float random(float min, float max)
Returns a uniform distributed random float number between min and max.