Skip to content

MidoriYakumo/learnopengl-qt3d

Repository files navigation

learnopengl-qt3d

Qt3D version of LearnOpenGL examples, currently works with Qt5.9. I created this repo aiming to understand how Qt3D works.

Pure QML version, use qmlscene to run with default OpenGL Context:

Try it with Qt5.9+:

	qmlscene -I https://raw.githubusercontent.com/MidoriYakumo/qml-virtualkey/master/ https://raw.githubusercontent.com/MidoriYakumo/learnopengl-qt3d/master/qml/app.qml

Compiled version, context set to GL4.3(Desktop)/GLES3.0(Mobile):

How to launch

learnopengl-qt3d can be launched from either qmlscene or compiled binary file.

Main qml file for qmlscene/binary/QmlCreator:

  • app.qml: main window with line chart FPS display

  • main.qml: QuickItem as root + text FPS display

With one keyword as arguments you can specify the sample to be launched:

  • qmlscene skybox app.qml
  • ./learnopengl-qt3d geometry

Notes

  • Some large assets from the website is downloaded by qmake script(*nix only), connection is required at the first build or after updated. Use CONFIG += no_assets to skip and enable local filesystem routing(may lead to crash). See main.cpp, assets.pri, Resources.qml for details.

  • leanopengl uses a little different lighting model from Qt3D default model, to rendering models for a better result, please slightly modify the ka, kd in mtl files

  • run qmltestrunner under qml/tests to perform unit tests or to generate screenshots.

Content

Getting started

  1. Hello Window : works
  2. Hello Triangle : works
  3. Shaders : works
  4. Texture : works
  5. Transformations : works
  6. Coordinate Systems : works
  7. Camera : works

Lighting

  1. Colors : works
  2. Basic Lighting : works
  3. Materials : works
  4. Lighting-maps : works
  5. Light-casters : works