diff options
author | Kaj Grönholm <kaj.gronholm@qt.io> | 2020-10-15 12:40:32 +0300 |
---|---|---|
committer | Kaj Grönholm <kaj.gronholm@qt.io> | 2020-10-16 07:37:35 +0300 |
commit | 747ed180415327c1ece00cc469a1a6170066a0ae (patch) | |
tree | 825681fd961855bc2a46d0f9ab7b9686060fa559 | |
parent | c3e33e9b4d5e7170c787a76d0a168ad18272704d (diff) |
Improve runtime build options documentation
Task-number: QT3DS-4185
Change-Id: Id23f07dc07547c37643081a5116b84be3ccd0d4b
Reviewed-by: Tony Leinonen <tony.leinonen@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | commonplatform.pri | 17 | ||||
-rw-r--r-- | src/api/studio3d/doc/src/building-opengl-runtime.qdoc | 10 | ||||
-rw-r--r-- | src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h | 4 |
3 files changed, 27 insertions, 4 deletions
diff --git a/commonplatform.pri b/commonplatform.pri index 1efc50c..0caee32 100644 --- a/commonplatform.pri +++ b/commonplatform.pri @@ -18,15 +18,24 @@ DEFINES += \ _UNICODE \ NO_BOOST -# Enable this define if all ASTC images should be considered as premultiplied. -# Alternatively to enable this at runtime, set QT3DS_ALL_ASTC_PREMULTIPLIED env variable. -#DEFINES += QT3DS_ALL_ASTC_PREMULTIPLIED - # Enable this to build runtime with perf logging on. # At runtime to see logs, you should also enable "qt3ds.perf_info" # category e.g. with "QT_LOGGING_RULES=qt3ds.perf_info=true" #DEFINES += QT3DS_ENABLE_PERF_LOGGING +# Enable this to set the maximum amount of lights. The default value is 16. +#DEFINES += QT3DS_MAX_NUM_LIGHTS=16 + +# Enable this to set the maximum amount of shadows The default value is 8. +#DEFINES += QT3DS_MAX_NUM_SHADOWS=8 + +# Enable this to use legacy ASTC loading methods. +#DEFINES += LEGACY_ASTC_LOADING + +# Enable this define if all ASTC images should be considered as premultiplied. +# Alternatively to enable this at runtime, set QT3DS_ALL_ASTC_PREMULTIPLIED env variable. +#DEFINES += QT3DS_ALL_ASTC_PREMULTIPLIED + win32: PlatformSpecificDir = windows macos: PlatformSpecificDir = macos linux|integrity|qnx: PlatformSpecificDir = linux diff --git a/src/api/studio3d/doc/src/building-opengl-runtime.qdoc b/src/api/studio3d/doc/src/building-opengl-runtime.qdoc index f33715c..30822bb 100644 --- a/src/api/studio3d/doc/src/building-opengl-runtime.qdoc +++ b/src/api/studio3d/doc/src/building-opengl-runtime.qdoc @@ -75,6 +75,16 @@ Log format is: \c {(n) [task name] - [time] = [cumulative time]} where: \note \c QT3DS_ENABLE_PERF_LOGGING should not be enabled in release builds as logging increases performance overhead. +\section2 Shadows and Lights +To optimize the supported shadows and lights amount, you can define QT3DS_MAX_NUM_LIGHTS and QT3DS_MAX_NUM_SHADOWS. + +\section2 Legacy ASTC +To enable legacy ASTC which means that ASTC files are not loaded until needed for texture creation, define LEGACY_ASTC_LOADING. + +\section2 Premultiplied ASTC +To force all ASTC compressed images to be treated as premultiplied, you can enable this. Alternatively if you want +to do this at runtime, set QT3DS_ALL_ASTC_PREMULTIPLIED as an environment variable. + \section1 Build Instructions \list diff --git a/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h b/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h index 5d70931..ae46f49 100644 --- a/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h +++ b/src/runtimerender/Qt3DSRenderMaterialShaderGenerator.h @@ -40,8 +40,12 @@ namespace qt3ds { namespace render { // these are our current shader limits +#ifndef QT3DS_MAX_NUM_LIGHTS #define QT3DS_MAX_NUM_LIGHTS 16 +#endif +#ifndef QT3DS_MAX_NUM_SHADOWS #define QT3DS_MAX_NUM_SHADOWS 8 +#endif // note this struct must exactly match the memory layout of the // struct sampleLight.glsllib and sampleArea.glsllib. If you make changes here you need |