Skip to content

Commit

Permalink
terrain: Use QgsTextureMaterial for non shading texture
Browse files Browse the repository at this point in the history
There is no functional change. With this change, the terrain uses a
material defined by QGIS instead of a default Qt3D. This will make it
easier to customize the shader in the future.
  • Loading branch information
ptitjano committed Jul 16, 2024
1 parent 2499db1 commit b292e94
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/3d/terrain/qgsterraintileloader_p.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,12 @@
#include "qgsterraintexturegenerator_p.h"
#include "qgsterraintileentity_p.h"
#include "qgscoordinatetransform.h"
#include "qgstexturematerial.h"

#include <Qt3DRender/QTexture>
#include <Qt3DRender/QTechnique>
#include <Qt3DRender/QCullFace>

#include <Qt3DExtras/QTextureMaterial>

/// @cond PRIVATE

QgsTerrainTileLoader::QgsTerrainTileLoader( QgsTerrainEntity *terrain, QgsChunkNode *node )
Expand Down Expand Up @@ -67,7 +66,7 @@ void QgsTerrainTileLoader::createTextureComponent( QgsTerrainTileEntity *entity,
}
else
{
Qt3DExtras::QTextureMaterial *textureMaterial = new Qt3DExtras::QTextureMaterial;
QgsTextureMaterial *textureMaterial = new QgsTextureMaterial;
textureMaterial->setTexture( texture );
material = textureMaterial;
}
Expand Down

0 comments on commit b292e94

Please sign in to comment.