blob: 7155bfc70dc1863f985fd3a878b9e1872b4438b5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
/*!
\example advancedcustommaterial
\title Qt 3D: Advanced Custom Material QML Example
\ingroup qt3d-examples-qml
\brief Demonstrates creating advanced materials in Qt3D.
\image advanced-custom-material.jpg
\e This example demonstrates creating advanced custom materials.
\include examples-run.qdocinc
\section1 Description
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 \c {.obj} file.
Shader properties that user can control, are defined in \c {advancedcustommaterial/WaterMaterial.qml}.
\section1 Controls
\section2 Texture scale slider
Multiplies texture coordinates inside the vertex shader. Controls the size of the textures
on water surface.
\section2 Texture speed slider
Offsets values for texture coordinates which are animated in
\c {advancedcustommaterial/Water.qml} and then passed to vertex shader.
Creates the effect of textures scrolling over the surface.
\section2 Specularity
Multiplies specular texture values inside fragment shader. Makes the water reflective.
\section2 Distortion
Multiplies the offset in red and blue channels of wave texture in fragment shader.
Makes the surface textures animate more randomly.
\section2 Normal amount
Multiplies the normal map values inside fragment shader. Controls the visibility of
smaller waves on the water surface.
\section2 Wave speed
Modifies the frequency of the sine wave inside vertex shader. Controls the speed of the waves.
\section2 Wave height
Multiplies the vertex \c {Y} position inside vertex shader. Controls the height of the waves.
\section2 Mesh rotation
Rotates the water mesh in \c {advancedcustommaterial/Water.qml}.
*/
|