22 info(
"Texture map blending with depth sorting. Transparent tree rectangles in view "
23 "frustum are rendered back to front. You can turn on/off alpha sorting in the "
24 "menu Preferences of press key J.");
33 GL_LINEAR_MIPMAP_LINEAR,
41 GL_LINEAR_MIPMAP_LINEAR,
81 pNW.push_back(
SLVec3f(0, 0, 0));
82 tNW.push_back(
SLVec2f(0.5f, 0.0f));
83 pNW.push_back(
SLVec3f(1, 0, 0));
84 tNW.push_back(
SLVec2f(1.0f, 0.0f));
85 pNW.push_back(
SLVec3f(1, 2, 0));
86 tNW.push_back(
SLVec2f(1.0f, 1.0f));
87 pNW.push_back(
SLVec3f(0, 2, 0));
88 tNW.push_back(
SLVec2f(0.5f, 1.0f));
89 pSE.push_back(
SLVec3f(-1, 0, 0));
90 tSE.push_back(
SLVec2f(0.0f, 0.0f));
91 pSE.push_back(
SLVec3f(0, 0, 0));
92 tSE.push_back(
SLVec2f(0.5f, 0.0f));
93 pSE.push_back(
SLVec3f(0, 2, 0));
94 tSE.push_back(
SLVec2f(0.5f, 1.0f));
95 pSE.push_back(
SLVec3f(-1, 2, 0));
96 tSE.push_back(
SLVec2f(0.0f, 1.0f));
123 pG.push_back(
SLVec3f(-size, 0, size));
125 pG.push_back(
SLVec3f(size, 0, size));
127 pG.push_back(
SLVec3f(size, 0, -size));
129 pG.push_back(
SLVec3f(-size, 0, -size));
144 for (
SLint iZ = -res; iZ <= res; ++iZ)
146 for (
SLint iX = -res; iX <= res; ++iX)
148 if (iX != 0 || iZ != 0)
The AppCommon class holds the top-level instances of the app-demo.
Class declaration for an SLScene inherited class.
#define SL_DB_CULLOFF
Turn off face culling.
vector< SLVec2f > SLVVec2f
SLVec2< SLfloat > SLVec2f
vector< SLVec3f > SLVVec3f
SLVec3< SLfloat > SLVec3f
SLVec4< SLfloat > SLCol4f
static SLDeviceRotation devRot
Mobile device rotation from IMU.
static SLDeviceLocation devLoc
Mobile device location from GPS.
static SLstring texturePath
Path to texture images.
static SLstring shaderPath
Path to GLSL shader programs.
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.
AppDemoSceneTextureBlend()
void addProgramToLoad(SLGLProgram *&program, const SLstring &vertShaderFile, const SLstring &fragShaderFile)
Add generic GLSL program with shader files 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 devRotLoc(SLDeviceRotation *devRot, SLDeviceLocation *devLoc)
void focalDist(const SLfloat f)
SLBackground & background()
void on(SLuint bit)
Turns the specified bit on.
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 addTexture(SLGLTexture *texture)
Adds the passed texture to the equivalent texture type vector.
void program(SLGLProgram *sp)
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)
SLPolygon creates a convex polyon mesh.
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)
float random(float min, float max)
Returns a uniform distributed random float number between min and max.