Skip to content

Commit 5fbeb3c

Browse files
feat: dynamic lights (#234)
* Initial draft of LightSource component * Fixed conflicting ids * Refactor structure * Fixed ids * Removed unused property and adjusted ids again * Fixed color reference * Fixed lowecase to oneof name * Test to fix proto builds * Renamed file to properly generate classes with the intended name * Updated documentation * Added cookie field * Added missing import * Fixed proper type reference * Set optional properties, improved documentation * Updated shadow mask type to TextureUnion * Reordered properties to support different defaults on different messages
1 parent b3fea33 commit 5fbeb3c

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
syntax = "proto3";
2+
package decentraland.sdk.components;
3+
import "decentraland/sdk/components/common/id.proto";
4+
import "decentraland/common/colors.proto";
5+
import "decentraland/common/texture.proto";
6+
option (common.ecs_component_id) = 1079;
7+
8+
message PBLightSource {
9+
optional bool active = 4; // default = true, whether the lightSource is active or not.
10+
optional decentraland.common.Color3 color = 1; // default = Color.white, the tint of the light, in RGB format where each component is a floating point value with a range from 0 to 1.
11+
optional float brightness = 2; // default = 250, ranges from 1 (dim) to 100,000 (very bright), expressed in Lumens for Point and Spot.
12+
optional float range = 3; // default = 10, how far the light travels, expressed in meters.
13+
14+
oneof type {
15+
Point point = 6;
16+
Spot spot = 7;
17+
}
18+
19+
message Point {
20+
optional ShadowType shadow = 5; // default = ShadowType.ST_NONE The type of shadow the light source supports.
21+
}
22+
23+
message Spot {
24+
optional float inner_angle = 1; // default = 21.8. Inner angle can't be higher than outer angle, otherwise will default to same value. Min value is 0. Max value is 179.
25+
optional float outer_angle = 2; // default = 30. Outer angle can't be lower than inner angle, otherwise will inner angle will be set to same value. Max value is 179.
26+
optional ShadowType shadow = 5; // default = ShadowType.ST_NONE The type of shadow the light source supports.
27+
optional decentraland.common.TextureUnion shadow_mask_texture = 8; // Texture mask through which shadows are cast to simulate caustics, soft shadows, and light shapes such as light entering from a window.
28+
}
29+
30+
enum ShadowType {
31+
ST_NONE = 0; // No shadows are cast from this LightSource.
32+
ST_SOFT = 1; // More realistic type of shadow that reduces block artifacts, noise or pixelation, but requires more processing.
33+
ST_HARD = 2; // Less realistic type of shadow but more performant, uses hard edges.
34+
}
35+
}

0 commit comments

Comments
 (0)