# With Qt 6.12, the SkyMaterial is the limit

DevFeed: [With Qt 6.12, the SkyMaterial is the limit](<https://devfeed.tech/articles/with-qt-6-12-the-skymaterial-is-the-limit-100627.md>)

Original publisher: [Read original article](<https://www.qt.io/blog/with-qt-6.12-the-skymaterial-is-the-limit>)

Author: jonas.karlsson@qt.io (Jonas Karlsson)

Published: 2026-10-26T15:58:41Z

Content type: tutorial

Language: en

Sources: [Qt](<https://devfeed.tech/sources/qt-blog.md>)

Topics: [3D](<https://devfeed.tech/topics/3d.md>), [render](<https://devfeed.tech/topics/render.md>), [CUDA Tile](<https://devfeed.tech/topics/cuda-tile.md>)

Tags: [3d](<https://devfeed.tech/tags/3d.md>), [code](<https://devfeed.tech/tags/code.md>), [fragment](<https://devfeed.tech/tags/fragment.md>), [gpu](<https://devfeed.tech/tags/gpu.md>), [graphics](<https://devfeed.tech/tags/graphics.md>), [image](<https://devfeed.tech/tags/image.md>), [light](<https://devfeed.tech/tags/light.md>), [lighting](<https://devfeed.tech/tags/lighting.md>), [performance](<https://devfeed.tech/tags/performance.md>), [qml](<https://devfeed.tech/tags/qml.md>), [qt](<https://devfeed.tech/tags/qt.md>), [qt-6](<https://devfeed.tech/tags/qt-6.md>), [qt-6-12](<https://devfeed.tech/tags/qt-6-12.md>), [qt-quick](<https://devfeed.tech/tags/qt-quick.md>), [render](<https://devfeed.tech/tags/render.md>), [rendering](<https://devfeed.tech/tags/rendering.md>)

## AI overview

Qt Quick 3D 6.12's SkyMaterial lets a custom fragment shader render the visible sky and provide image-based lighting from the same environment. Assign it to SceneEnvironment::skyMaterial and set backgroundMode to SceneEnvironment.SkyMaterial. Shader code defines MAIN(), reads qt_eyeDir, and writes FRAGCOLOR; compatible QML properties are exposed to the shader, and changing them triggers a rerender. The default Cubemap mode renders six faces and, with IBL enabled, generates lighting maps; static skies can then be sampled cheaply. For frequently changing skies that do not need IBL, disabling enableIBL and using a ScreenSpaceFull, Half, or Quarter mode avoids cubemap and IBL rendering, but runs the shader every frame at the selected resolution. Cubemap resolution affects update cost, while iblSampleCount controls IBL quality. The article demonstrates animated sky rotation and a procedural sky with tunable sky, ground, and sun properties.

## Source excerpt

Qt Quick 3D 6.12 introduces a new SkyMaterial QML type, and in this post we will explain what it is, how to use it and why you'd want to. SkyMaterial provides a way of writing custom fragment shader code to render a scene's sky, as well as computing image-based lighting (IBL) from it. This means the same sky acts as both the visible background and a light source for the scene. With it you can create a dynamic sky with a moving sun, day/night cycle, clouds, stars etc. QML properties set on the SkyMaterial type are automatically made available in the custom shader, and whenever a property is updated, the SkyMaterial re-renders itself. This is what makes it possible to have a dynamic sky. Since the rendering is happening on the GPU, the performance cost depends on the complexity of the shader and how often it is updated. It is possible to tweak certain quality and performance properties to fit your performance budget. To use SkyMaterial in your 3D scene you need to point the SceneEnvironment::skyMaterial property to your SkyMaterial object, and set SceneEnvironment::backgroundMode to SceneEnvironment.SkyMaterial.