This repository has been archived by the owner on Nov 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathKDAB_custom_material.txt
84 lines (76 loc) · 2.42 KB
/
KDAB_custom_material.txt
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
KDAB_custom_material extension
# JSON Schema
{
"extensionsUsed": [
"KDAB_custom_material"
],
"extensionsRequired": [
"KDAB_custom_material"
],
"materials": [
{
"name": "MySemDiffuseMaterial",
"pbrMetallicRoughness": {
"baseColorFactor": [ 0.5, 0.8, 0.0, 1.0 ]
},
"normalTexture": {},
"occlusionTexture": {},
"emissiveTexture": {},
"alphaMode": "BLEND",
"alphaCutOff": 0.5,
"emissiveFactor": [0.2, 0.4, 0.1],
"doubleSided": false,
"extensions": {
"KDAB_custom_material": {
"type": "SemDiffuse",
"properties": {
"diffuseInnerFilter": [1.0, 0.5, 0.25, 1.0],
"diffuseOuterFilter": [1.0, 0.5, 0.25, 1.0],
"diffuseMap": { "index": 2, "texCoord": 1 }
}
}
}
}
]
}
# Kuesa Material Description -> used to generate C++/QML Kuesa classes
{
"type": "SemDiffuse",
"properties": [
{ "name": "diffuseInnerFilter", "type": "vec4" },
{ "name": "diffuseOuterFilter", "type": "vec4" },
{ "name": "diffuseMap", "type": "texture2d" }
],
passes: [
{
"blending": {
"function": "Add",
"sourceRGB": "SourceAlpha",
"sourceAlpha": "SourceAlpha",
"destinationRGB": "OneMinusSourceAlpha",
"destinationAlpha": "One"
},
"type": "Transparent|Opaque|TransparentAndOpaque|MultiPassTransparent"
"shaders": [
{
"format": {
"api": "OpenGLES",
"major": 2,
"minor": 0
},
"type": "Fragment",
"code": "#version ..."
"graph": "qrc:/path/to/graph"
}
]
}
]
}
# The generator will generate SemDiffuseMaterial, SemDiffuseProperties,
# SemDiffuseShaderData and SemDiffuseEffect
# Once classes have been generated:
## the .pri needs to be imported in the
project .pro
## GLTF2Importer::registerCustomMaterial<MaterialClass, PropertiesClass,
EffectClass>("SemDiffuse"); needs to be called prior to parsing the gltf
file.