Skip to content
Merged
Changes from 12 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions proto/decentraland/sdk/components/light_source.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
syntax = "proto3";
package decentraland.sdk.components;
import "decentraland/sdk/components/common/id.proto";
import "decentraland/common/colors.proto";
option (common.ecs_component_id) = 1079;

message PBLightSource {
bool active = 4; // default = true
decentraland.common.Color3 color = 1; // default = Color.white
float brightness = 2; // range from 1 (dim) to 100,000 (very bright), expressed in Lumens for Point and Spot
float range = 3; // default = 10, expressed in meters
ShadowType shadow = 5; // default = ShadowType.ST_NONE

@kuruk-mm kuruk-mm Jan 25, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We believe that the default value of range should be based on brightness. The default could be equation using brightness as a value.

Additionally, if you want to implement this with a "default" value, you should mark it as optional float range = 3.

Only "optional" values can have default values, which are not required to be specified in the SDK (you will receive undefined or null in Unity, and you need to interpret that as the default).


oneof type {
Point point = 6;
Spot spot = 7;
}

message Point {}

message Spot {
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
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
}

enum ShadowType {
ST_NONE = 0;
ST_SOFT = 1;
ST_HARD = 2;
}
}