Qt 3D: Advanced custom material QML Example

This example demonstrates creating advanced custom materials.

運行範例

要運行範例從 Qt Creator ,打開 歡迎 模式,然後選擇範例從 範例 。更多信息,拜訪 構建和運行範例 .

描述

Advanced custom material example shows more complex shaders, and demonstrates controlling your shader properties with QtQuick user interface and Animation. Water is a 3D mesh, that is modeled and uv mapped inside Blender, and then brought into Scene 3D as an .obj file. Shader properties that user can control, are defined in WaterMaterial .

控件

紋理比例縮放滑塊

Multiplies texture coordinates inside the vertex shader. Controls the size of the textures on water surface.

紋理速度滑塊

Offsets values for texture coordinates which are animated in Water.qml and then passed to vertex shader. Creates the effect of textures scrolling over the surface.

Specularity

Multiplies specular texture values inside fragment shader. Makes the water reflective.

失真

Multiplies the offset in red and blue channels of wave texture in fragment shader. Makes the surface textures animate more randomly.

Normal amount

Multiplies the normal map values inside fragment shader. Controls the visibility of smaller waves on the water surface.

波浪速度

Modifies the frequency of the sine wave inside vertex shader. Controls the speed of the waves.

波浪高度

Multiplies the vertex Y position inside vertex shader. Controls the height of the waves.

網格鏇轉

Rotates the water mesh in Water.qml .

文件: