@dcl/sdk 7.0.0-3445306719.commit-c9822af → 7.0.0-3472029894.commit-ae9be34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ecs7/index.d.ts +417 -409
- package/dist/ecs7/index.js +350 -148
- package/dist/ecs7/index.min.js +1 -1
- package/dist/ecs7/index.min.js.map +1 -1
- package/dist/ecs7/proto-definitions/material.proto +35 -21
- package/dist/playground/snippets/billboard.ts +9 -4
- package/dist/playground/snippets/material.ts +29 -14
- package/package.json +5 -5
- package/types/ecs7/index.d.ts +336 -328
@@ -17,26 +17,40 @@ enum MaterialTransparencyMode {
|
|
17
17
|
}
|
18
18
|
|
19
19
|
message PBMaterial {
|
20
|
-
|
20
|
+
message UnlitMaterial {
|
21
|
+
optional decentraland.common.TextureUnion texture = 1; // default = null
|
22
|
+
optional float alpha_test = 2; // default = 0.5. range value: from 0 to 1
|
23
|
+
optional bool cast_shadows = 3; // default = true
|
24
|
+
}
|
25
|
+
|
26
|
+
message PbrMaterial {
|
27
|
+
optional decentraland.common.TextureUnion texture = 1; // default = null
|
28
|
+
|
29
|
+
optional float alpha_test = 2; // default = 0.5. range value: from 0 to 1
|
30
|
+
optional bool cast_shadows = 3; // default = true
|
31
|
+
|
32
|
+
optional decentraland.common.TextureUnion alpha_texture = 4; // default = null
|
33
|
+
optional decentraland.common.TextureUnion emissive_texture = 5; // default = null
|
34
|
+
optional decentraland.common.TextureUnion bump_texture = 6; // default = null
|
35
|
+
|
36
|
+
optional decentraland.common.Color3 albedo_color = 7; // default = white;
|
37
|
+
optional decentraland.common.Color3 emissive_color = 8; // default = black;
|
38
|
+
optional decentraland.common.Color3 reflectivity_color = 9; // default = white;
|
39
|
+
|
40
|
+
optional MaterialTransparencyMode transparency_mode = 10; // default = TransparencyMode.Auto
|
41
|
+
|
42
|
+
optional float metallic = 11; // default = 0.5
|
43
|
+
optional float roughness = 12; // default = 0.5
|
44
|
+
optional float glossiness = 13; // default = 1
|
45
|
+
|
46
|
+
optional float specular_intensity = 14; // default = 1
|
47
|
+
optional float emissive_intensity = 15; // default = 2
|
48
|
+
optional float direct_intensity = 16; // default = 1
|
49
|
+
}
|
50
|
+
|
51
|
+
oneof material {
|
52
|
+
UnlitMaterial unlit = 1;
|
53
|
+
PbrMaterial pbr = 2;
|
54
|
+
}
|
21
55
|
|
22
|
-
optional float alpha_test = 2; // default = 0.5. range value: from 0 to 1
|
23
|
-
optional bool cast_shadows = 3; // default = true
|
24
|
-
|
25
|
-
optional decentraland.common.TextureUnion alpha_texture = 4; // default = null
|
26
|
-
optional decentraland.common.TextureUnion emissive_texture = 5; // default = null
|
27
|
-
optional decentraland.common.TextureUnion bump_texture = 6; // default = null
|
28
|
-
|
29
|
-
optional decentraland.common.Color3 albedo_color = 7; // default = white;
|
30
|
-
optional decentraland.common.Color3 emissive_color = 8; // default = black;
|
31
|
-
optional decentraland.common.Color3 reflectivity_color = 9; // default = white;
|
32
|
-
|
33
|
-
optional MaterialTransparencyMode transparency_mode = 10; // default = TransparencyMode.Auto
|
34
|
-
|
35
|
-
optional float metallic = 11; // default = 0.5
|
36
|
-
optional float roughness = 12; // default = 0.5
|
37
|
-
optional float glossiness = 13; // default = 1
|
38
|
-
|
39
|
-
optional float specular_intensity = 14; // default = 1
|
40
|
-
optional float emissive_intensity = 15; // default = 2
|
41
|
-
optional float direct_intensity = 16; // default = 1
|
42
56
|
}
|
@@ -2,10 +2,15 @@ function createPlaneTexture(x: number, y: number, z: number): Entity {
|
|
2
2
|
const meshEntity = engine.addEntity()
|
3
3
|
|
4
4
|
Material.create(meshEntity, {
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
texture: {
|
5
|
+
material: {
|
6
|
+
$case: 'pbr',
|
7
|
+
pbr: {
|
8
|
+
texture: {
|
9
|
+
tex: {
|
10
|
+
$case: 'texture',
|
11
|
+
texture: { src: 'models/polaroid2.png' }
|
12
|
+
}
|
13
|
+
}
|
9
14
|
}
|
10
15
|
}
|
11
16
|
})
|
@@ -6,27 +6,42 @@ function createSphere(x: number, y: number, z: number): Entity {
|
|
6
6
|
}
|
7
7
|
|
8
8
|
Material.create(createSphere(15, 1, 15), {
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
material: {
|
10
|
+
$case: 'pbr',
|
11
|
+
pbr: {
|
12
|
+
albedoColor: { r: 0, g: 0, b: 1 },
|
13
|
+
reflectivityColor: { r: 0.5, g: 0.5, b: 0.5 },
|
14
|
+
metallic: 0.8,
|
15
|
+
roughness: 0.1
|
16
|
+
}
|
17
|
+
}
|
13
18
|
})
|
14
19
|
|
15
20
|
Material.create(createSphere(13, 1, 15), {
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
21
|
+
material: {
|
22
|
+
$case: 'pbr',
|
23
|
+
pbr: {
|
24
|
+
albedoColor: { r: 1, g: 1, b: 0 },
|
25
|
+
reflectivityColor: { r: 0.5, g: 0.5, b: 0.5 },
|
26
|
+
metallic: 0.1,
|
27
|
+
roughness: 0.8,
|
20
28
|
|
21
|
-
|
22
|
-
|
29
|
+
alphaTest: 0.2,
|
30
|
+
transparencyMode: MaterialTransparencyMode.MTM_ALPHA_TEST
|
31
|
+
}
|
32
|
+
}
|
23
33
|
})
|
24
34
|
|
25
35
|
Material.create(createSphere(11, 1, 15), {
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
36
|
+
material: {
|
37
|
+
$case: 'pbr',
|
38
|
+
pbr: {
|
39
|
+
albedoColor: { r: 0, g: 0, b: 1 },
|
40
|
+
reflectivityColor: { r: 0.5, g: 0.5, b: 0.5 },
|
41
|
+
metallic: 0.1,
|
42
|
+
roughness: 0.1
|
43
|
+
}
|
44
|
+
}
|
30
45
|
})
|
31
46
|
|
32
47
|
// add textures
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@dcl/sdk",
|
3
|
-
"version": "7.0.0-
|
3
|
+
"version": "7.0.0-3472029894.commit-ae9be34",
|
4
4
|
"description": "",
|
5
5
|
"main": "dist/src/index.js",
|
6
6
|
"typings": "dist/index.d.ts",
|
@@ -23,13 +23,13 @@
|
|
23
23
|
"artifacts"
|
24
24
|
],
|
25
25
|
"dependencies": {
|
26
|
-
"@dcl/amd": "7.0.0-
|
27
|
-
"@dcl/build-ecs": "7.0.0-
|
28
|
-
"@dcl/js-runtime": "7.0.0-
|
26
|
+
"@dcl/amd": "7.0.0-3472029894.commit-ae9be34",
|
27
|
+
"@dcl/build-ecs": "7.0.0-3472029894.commit-ae9be34",
|
28
|
+
"@dcl/js-runtime": "7.0.0-3472029894.commit-ae9be34",
|
29
29
|
"@dcl/kernel": "^1.0.0-3339209749.commit-fa9e5d7",
|
30
30
|
"@dcl/posix": "^1.0.4",
|
31
31
|
"@dcl/unity-renderer": "^1.0.59980-20221027151836.commit-cc26142"
|
32
32
|
},
|
33
33
|
"minCliVersion": "3.12.3",
|
34
|
-
"commit": "
|
34
|
+
"commit": "ae9be34125f89c6a434dc8e6d9f4e4b50ae84baa"
|
35
35
|
}
|