Scenery3d.cpp   Scenery3d.cpp 
skipping to change at line 95 skipping to change at line 95
loadCancel(false), loadCancel(false),
cubemapSize(1024),shadowmapSize(1024), cubemapSize(1024),shadowmapSize(1024),
absolutePosition(0.0, 0.0, 0.0), moveVector(0.0, 0.0, 0.0), movement( 0.0f,0.0f,0.0f), eye_height(0.0f), absolutePosition(0.0, 0.0, 0.0), moveVector(0.0, 0.0, 0.0), movement( 0.0f,0.0f,0.0f), eye_height(0.0f),
core(NULL), landscapeMgr(NULL), heightmap(NULL), heightmapLoad(NULL) , core(NULL), landscapeMgr(NULL), heightmap(NULL), heightmapLoad(NULL) ,
mainViewUp(0.0, 0.0, 1.0), mainViewDir(1.0, 0.0, 0.0), viewPos(0.0, 0 .0, 0.0), mainViewUp(0.0, 0.0, 1.0), mainViewDir(1.0, 0.0, 0.0), viewPos(0.0, 0 .0, 0.0),
drawnTriangles(0), drawnModels(0), materialSwitches(0), shaderSwitche s(0), drawnTriangles(0), drawnModels(0), materialSwitches(0), shaderSwitche s(0),
requiresCubemap(false), cubemappingUsedLastFrame(false), requiresCubemap(false), cubemappingUsedLastFrame(false),
lazyDrawing(false), updateOnlyDominantOnMoving(true), updateSecondDom inantOnMoving(true), needsMovementEndUpdate(false), lazyDrawing(false), updateOnlyDominantOnMoving(true), updateSecondDom inantOnMoving(true), needsMovementEndUpdate(false),
needsCubemapUpdate(true), needsMovementUpdate(false), lazyInterval(2. 0), lastCubemapUpdate(0.0), lastCubemapUpdateRealTime(0), lastMovementEndRe alTime(0), needsCubemapUpdate(true), needsMovementUpdate(false), lazyInterval(2. 0), lastCubemapUpdate(0.0), lastCubemapUpdateRealTime(0), lastMovementEndRe alTime(0),
cubeMapCubeTex(0), cubeMapCubeDepth(0), cubeMapTex(), cubeRB(0), domi nantFace(0), secondDominantFace(1), cubeFBO(0), cubeSideFBO(), cubeMappingC reated(false), cubeMapCubeTex(0), cubeMapCubeDepth(0), cubeMapTex(), cubeRB(0), domi nantFace(0), secondDominantFace(1), cubeFBO(0), cubeSideFBO(), cubeMappingC reated(false),
cubeVertexBuffer(QOpenGLBuffer::VertexBuffer), cubeIndexBuffer(QOpenG LBuffer::IndexBuffer), cubeIndexCount(0), cubeVertexBuffer(QOpenGLBuffer::VertexBuffer), transformedCubeVertexB uffer(QOpenGLBuffer::VertexBuffer), cubeIndexBuffer(QOpenGLBuffer::IndexBuf fer), cubeIndexCount(0),
lightOrthoNear(0.1f), lightOrthoFar(1000.0f), parallaxScale(0.015f) lightOrthoNear(0.1f), lightOrthoFar(1000.0f), parallaxScale(0.015f)
{ {
#ifndef NDEBUG #ifndef NDEBUG
qDebug()<<"Scenery3d constructor..."; qDebug()<<"Scenery3d constructor...";
#endif #endif
//the arrays should all contain only zeroes //the arrays should all contain only zeroes
Q_ASSERT(cubeMapTex[0]==0); Q_ASSERT(cubeMapTex[0]==0);
Q_ASSERT(cubeSideFBO[0]==0); Q_ASSERT(cubeSideFBO[0]==0);
shaderParameters.openglES = false; shaderParameters.openglES = false;
skipping to change at line 1620 skipping to change at line 1620
//setup shader params //setup shader params
projectionMatrix = altAzProjector->getProjectionMatrix().convertToQM atrix(); projectionMatrix = altAzProjector->getProjectionMatrix().convertToQM atrix();
cubeShader->setUniformValue(shaderManager.uniformLocation(cubeShader ,ShaderMgr::UNIFORM_MAT_PROJECTION), projectionMatrix); cubeShader->setUniformValue(shaderManager.uniformLocation(cubeShader ,ShaderMgr::UNIFORM_MAT_PROJECTION), projectionMatrix);
cubeShader->setUniformValue(shaderManager.uniformLocation(cubeShader ,ShaderMgr::UNIFORM_TEX_DIFFUSE),0); cubeShader->setUniformValue(shaderManager.uniformLocation(cubeShader ,ShaderMgr::UNIFORM_TEX_DIFFUSE),0);
cubeVertexBuffer.bind(); cubeVertexBuffer.bind();
if(cubemappingMode>=S3DEnum::CM_CUBEMAP) if(cubemappingMode>=S3DEnum::CM_CUBEMAP)
cubeShader->setAttributeBuffer(ShaderMgr::ATTLOC_TEXCOORD,GL _FLOAT,0,3); cubeShader->setAttributeBuffer(ShaderMgr::ATTLOC_TEXCOORD,GL _FLOAT,0,3);
else // 2D tex coords are stored in the same buffer, but with an off set else // 2D tex coords are stored in the same buffer, but with an off set
cubeShader->setAttributeBuffer(ShaderMgr::ATTLOC_TEXCOORD,GL _FLOAT,cubeVertices.size() * sizeof(Vec3f),2); cubeShader->setAttributeBuffer(ShaderMgr::ATTLOC_TEXCOORD,GL _FLOAT,cubeVertices.size() * sizeof(Vec3f),2);
cubeVertexBuffer.release();
cubeShader->enableAttributeArray(ShaderMgr::ATTLOC_TEXCOORD); cubeShader->enableAttributeArray(ShaderMgr::ATTLOC_TEXCOORD);
cubeShader->setAttributeArray(ShaderMgr::ATTLOC_VERTEX, reinterpret_ cubeVertexBuffer.release();
cast<const GLfloat*>(transformedCubeVertices.constData()),3);
//upload transformed vertex data
transformedCubeVertexBuffer.bind();
transformedCubeVertexBuffer.allocate(transformedCubeVertices.constDa
ta(), transformedCubeVertices.size() * sizeof(Vec3f));
cubeShader->setAttributeBuffer(ShaderMgr::ATTLOC_VERTEX, GL_FLOAT, 0
,3);
cubeShader->enableAttributeArray(ShaderMgr::ATTLOC_VERTEX); cubeShader->enableAttributeArray(ShaderMgr::ATTLOC_VERTEX);
transformedCubeVertexBuffer.release();
glEnable(GL_BLEND); glEnable(GL_BLEND);
//note that GL_ONE is required here for correct blending (see drawAr rays) //note that GL_ONE is required here for correct blending (see drawAr rays)
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
//depth test and culling is necessary for correct display, //depth test and culling is necessary for correct display,
//because the cube faces can be projected in quite "weird" ways //because the cube faces can be projected in quite "weird" ways
glEnable(GL_DEPTH_TEST); glEnable(GL_DEPTH_TEST);
//glDepthFunc(GL_LESS); //glDepthFunc(GL_LESS);
glDepthMask(GL_TRUE); glDepthMask(GL_TRUE);
glEnable(GL_CULL_FACE); glEnable(GL_CULL_FACE);
skipping to change at line 2059 skipping to change at line 2064
#endif #endif
//save opengl ES state //save opengl ES state
shaderParameters.openglES = ctx->isOpenGLES(); shaderParameters.openglES = ctx->isOpenGLES();
//find out what features we can enable //find out what features we can enable
determineFeatureSupport(); determineFeatureSupport();
cubeVertexBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw); cubeVertexBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
cubeVertexBuffer.create(); cubeVertexBuffer.create();
transformedCubeVertexBuffer.setUsagePattern(QOpenGLBuffer::StreamDra
w);
transformedCubeVertexBuffer.create();
cubeIndexBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw); cubeIndexBuffer.setUsagePattern(QOpenGLBuffer::StaticDraw);
cubeIndexBuffer.create(); cubeIndexBuffer.create();
//enable seamless cubemapping if HW supports it //enable seamless cubemapping if HW supports it
if(ctx->hasExtension("GL_ARB_seamless_cube_map")) if(ctx->hasExtension("GL_ARB_seamless_cube_map"))
{ {
#ifdef GL_TEXTURE_CUBE_MAP_SEAMLESS #ifdef GL_TEXTURE_CUBE_MAP_SEAMLESS
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS); glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
qDebug()<<"[Scenery3d] Seamless cubemap filtering enabled"; qDebug()<<"[Scenery3d] Seamless cubemap filtering enabled";
#endif #endif
 End of changes. 5 change blocks. 
4 lines changed or deleted 13 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/