From 747ed180415327c1ece00cc469a1a6170066a0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kaj=20Gr=C3=B6nholm?= Date: Thu, 15 Oct 2020 12:40:32 +0300 Subject: Improve runtime build options documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QT3DS-4185 Change-Id: Id23f07dc07547c37643081a5116b84be3ccd0d4b Reviewed-by: Tony Leinonen Reviewed-by: Tomi Korpipää --- commonplatform.pri | 17 +++++++++++++---- src/api/studio3d/doc/src/building-opengl-runtime.qdoc | 10 ++++++++++ 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 -- cgit v1.2.3