<div dir="ltr"><div>Hello, <br></div><div>I am using QGIS 3.42 with Qt5 cpp.</div><div>While loading qgs3dmapcanvas i got black screen. Can you suggest to resolve.</div><div>Here is the code <br></div><div>MainWindow::MainWindow(QWidget *parent)<br>    : QMainWindow(parent)<br>{<br>    // Set up the main window<br>    setWindowTitle("QGIS 3D Map Example");<br>    resize(800, 600);<br><br>    // Set OpenGL version to 4.2 (or higher)<br>    QSurfaceFormat format;<br>    format.setVersion(4, 2); // Request OpenGL 4.2<br>    format.setProfile(QSurfaceFormat::CoreProfile);<br>    format.setOption(QSurfaceFormat::DebugContext);<br>    QSurfaceFormat::setDefaultFormat(format);<br><br>    qDebug() << "OpenGL Version:" << format.version();<br><br>    // Load the TIFF file<br>    QString tiffFilePath = "/home/aman/Downloads/Data_Developing3d/Data_Developing3d/DEM.tif";<br>    rasterLayer = new QgsRasterLayer(tiffFilePath, "TIFF Layer");<br>    if (!rasterLayer->isValid()) {<br>        QMessageBox::warning(this, tr("Warning"), tr("Failed to load TIFF file."));<br>        return;<br>    } else {<br>        qDebug() << "TIFF file loaded successfully.";<br>    }<br><br>    // Set up 2D map canvas<br>    mapCanvas = new QgsMapCanvas(this);<br>    mapCanvas->setExtent(rasterLayer->extent());<br>    mapCanvas->setLayers(QList<QgsMapLayer *>() << rasterLayer);<br>    setCentralWidget(mapCanvas);<br><br>    // Set up 3D map settings<br>    map3DSettings = new Qgs3DMapSettings;<br>    map3DSettings->setLayers(QList<QgsMapLayer *>() << rasterLayer);<br>    map3DSettings->setCrs(QgsCoordinateReferenceSystem("EPSG:4326"));<br>    map3DSettings->setExtent(rasterLayer->extent());<br><br>    // Set up 3D map canvas<br>    map3DCanvas = new Qgs3DMapCanvas();<br>    map3DCanvas->setMapSettings(map3DSettings);<br>    map3DCanvas->resize(800, 600);<br>    // map3DCanvas->setParent(this); // Ensure the canvas has a parent<br>    map3DCanvas->show();<br>    // Add the 3D canvas to a container widget<br>}</div></div>