23 :
SLScene(
"Complex Fire Particle System"),
26 info(
"The fire particle systems contain each multiple sub particle systems.\n"
27 "See the scenegraph window for the sub particles systems. "
28 "See the properties window for the settings of the particles systems");
36 "ParticleFirecloudTransparent_C.png");
39 "ParticleFlames_06_8x8_C.png");
42 "ParticleCircle_05_C.png");
45 "ParticleCloudBlack_C.png");
48 "ParticleCloudWhite_C.png");
51 "ParticleFlames_04_16x4_C.png");
54 "ParticleSmoke_08_C.png");
58 "BrickLimestoneGray_1K_DIF.jpg",
63 "BrickLimestoneGray_1K_NRM.jpg",
69 "GLTF/Firewood/Firewood1.gltf",
78 "GLTF/Torch/Torch.gltf",
134 SLfloat pB = -0.01f, pT = 4.0f;
203 torchR->
name(
"Torch Right");
209 torchR->
rotate(-90, 0, 1, 0);
221 torchFlameNodeL->
translate(-1.6f, 2.25f, 0);
222 torchFlameNodeL->
name(
"Torch Fire Left");
233 torchFlameNodeR->
translate(1.6f, 2.25f, 0);
234 torchFlameNodeR->
name(
"Torch Fire Right");
258 const int NUM_NODES = 250;
261 for (
int i = 0; i < NUM_NODES; ++i)
273 fireComplex->
translate(-20.0f + (
float)(i % 20) * 2,
275 -(
float)((i - (
float)(i % 20)) / 20) * 4,
309 light1->
name(
"Fire light node");
339 SLNode* flameGlowNode =
new SLNode(glow,
"Fire glow node");
341 fireComplex->
addChild(flameGlowNode);
378 float sizeCPArrayFl[4] = {0.0f, 1.25f, 0.0f, 1.0f};
380 float sizeSEArrayFl[4] = {0.0f, 1.0f, 1.0f, 1.0f};
385 SLNode* fireFlameNode =
new SLNode(flame,
"Fire flame node");
387 fireComplex->
addChild(fireFlameNode);
398 "Fire smoke black PS");
404 float sizeCPArraySB[4] = {0.0f, 1.0f, 1.0f, 2.0f};
406 float sizeSEArraySB[4] = {0.0f, 1.0f, 1.0f, 2.0f};
413 float alphaCPArraySB[4] = {0.0f, 0.4f, 1.0f, 0.4f};
415 float alphaSEArraySB[4] = {0.0f, 0.0f, 1.0f, 0.0f};
424 SLNode* fireSmokeBlackNode =
new SLNode(smokeB,
"Fire smoke black node");
426 fireComplex->
addChild(fireSmokeBlackNode);
437 "Fire smoke white PS");
444 float sizeCPArraySW[4] = {0.0f, 0.5f, 1.0f, 2.0f};
446 float sizeSEArraySW[4] = {0.0f, 0.5f, 1.0f, 2.0f};
453 float alphaCPArraySW[4] = {0.0f, 0.018f, 1.0f, 0.018f};
455 float alphaSEArraySW[4] = {0.0f, 0.0f, 1.0f, 0.0f};
464 SLNode* fireSmokeWNode =
new SLNode(smokeW,
"Fire smoke white node");
466 fireComplex->
addChild(fireSmokeWNode);
477 "Fire sparks rising PS",
482 fireSparksRising->
scale(0.05f);
483 fireSparksRising->
radiusH(0.8f);
484 fireSparksRising->
radiusW(0.3f);
485 fireSparksRising->
doShape(
true);
491 fireSparksRising->
doColor(
true);
498 "Fire sparks rising node"));
523 light1->
name(
"Fire light node");
545 SLNode* fireGlowNode =
new SLNode(glow,
"Torch Glow Node");
572 SLNode* torchFlameNode =
new SLNode(flame,
"Torch Flame Node");
574 torchFire->
addChild(torchFlameNode);
The AppCommon class holds the top-level instances of the app-demo.
Definition of scene IDs in the demo app.
@ SID_ParticleSystem_ComplexFire
@ SID_Benchmark_ParticleSystemComplexFire
Class declaration for an SLScene inherited class.
#define SL_EXIT_MSG(message)
int SLSceneID
Scene identifier.
#define SL_ANISOTROPY_MAX
deque< SLNode * > SLVNode
SLVNode typedef for a vector of SLNodes.
SLScene SLSceneView SLint sceneID
Declares a color look up table functionality.
SLVec2< SLfloat > SLVec2f
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLCol4f
static SLstring modelPath
Path to 3D models.
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.
SLGLTexture * _texWallDIF
void assemble(SLAssetManager *am, SLSceneView *sv) override
After parallel loading of the assets the scene gets assembled in here.
SLGLTexture * _texFireCld
SLGLTexture * _texTorchFlm
AppDemoSceneParticleComplexFire(SLSceneID sceneID)
SLGLTexture * _texWallNRM
SLGLTexture * _texTorchSmk
SLNode * createComplexFire(SLAssetManager *am, SLScene *s, SLbool withLight, SLGLTexture *texFireCld, SLGLTexture *texFireFlm, SLint flipbookCols, SLint flipbookRows, SLGLTexture *texCircle, SLGLTexture *texSmokeB, SLGLTexture *texSmokeW)
Creates a complex fire group node.
SLGLTexture * _texFireFlm
SLNode * createTorchFire(SLAssetManager *am, SLScene *s, SLbool withLight, SLGLTexture *texFireCld, SLGLTexture *texFireFlm, SLint flipbookCols, SLint flipbookRows)
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 clipNear(const SLfloat cNear)
void focalDist(const SLfloat f)
SLBackground & background()
Texture object for OpenGL texturing.
void diffusePower(const SLfloat diffPow)
void diffuseColor(const SLCol4f &diff)
void attenuation(const SLfloat kConstant, const SLfloat kLinear, const SLfloat kQuadratic)
SLLightSpot class for a spot light source.
Defines a standard CG material with textures and a shader program.
void reflectionModel(SLReflectionModel rm)
void specular(const SLCol4f &spec)
void roughness(SLfloat r)
void metalness(SLfloat m)
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)
virtual SLNode * copyRec()
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)
void name(const SLstring &Name)
SLParticleSystem creates a particle meshes from a point primitive buffer.
void generateBernsteinPSize()
float * bezierControlPointSize()
float * bezierControlPointAlpha()
SLbool doFlipBookTexture()
float * bezierStartEndPointSize()
SLBillboardType billboardType()
float * bezierStartEndPointAlpha()
SLbool doAlphaOverLTCurve()
SLbool doBlendBrightness()
void doAcceleration(SLbool b)
SLbool doSizeOverLTCurve()
void generateBernsteinPAlpha()
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)
SLCamera * sceneViewCamera()
SLTexColorLUT defines a lookup table as an 1D texture of (256) RGBA values.