-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* lights initial * Pb -> PB --------- Co-authored-by: robtfm <[email protected]>
- Loading branch information
1 parent
0207676
commit f199bbd
Showing
4 changed files
with
88 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
syntax = "proto3"; | ||
package decentraland.sdk.components; | ||
|
||
import "decentraland/common/colors.proto"; | ||
import "decentraland/common/vectors.proto"; | ||
|
||
import "decentraland/sdk/components/common/id.proto"; | ||
option (common.ecs_component_id) = 1206; | ||
|
||
// defines the global scene light settings. must be added to the scene root. | ||
// to control sunlight color, intensity, shadows etc, you can also add a PBLight to the scene root. | ||
message PBGlobalLight { | ||
// the direction the directional light shines in. | ||
// default depends on time of day and explorer implementation | ||
optional decentraland.common.Vector3 direction = 1; | ||
// ambient light color | ||
// default: White | ||
optional decentraland.common.Color3 ambient_color = 2; | ||
// ambient light intensity. the explorer default ambient brightness is multiplied by this non-physical quantity. | ||
// default 1 | ||
optional float ambient_brightness = 3; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
syntax = "proto3"; | ||
package decentraland.sdk.components; | ||
|
||
import "decentraland/common/colors.proto"; | ||
|
||
import "decentraland/sdk/components/common/id.proto"; | ||
option (common.ecs_component_id) = 1204; | ||
|
||
// defines a light source. | ||
// the world has a default directional light (like sunlight) which can be overridden by adding the light component to the scene root. | ||
// a PBGlobalLight component can also be added to the root to control the directional light direction. | ||
// point lights (lightbulbs) or spotlights can be created by attaching the light component to non-root entities. | ||
message PBLight { | ||
// whether the light is on | ||
// default true | ||
optional bool enabled = 1; | ||
// light brightness in lux (lumens/m^2). | ||
// | ||
// for global directional light, this applies as a constant value at all surfaces and distances (though the effect on the surface still depends on incidence angle). | ||
// the default global light illuminance varies from 400 (sunrise/sunset) to 10,000 (midday). | ||
// for typical values, see https://en.wikipedia.org/wiki/Lux#Illuminance | ||
// | ||
// for point and spot lights, this is the lumens/m^2 at 1m distance from the light. to transform from raw lumens, | ||
// divide lumens by ~12 (4*pi). | ||
// e.g. a 100w household bulb with 1200 lumens would have an illuminance of ~100. | ||
// a lighthouse bulb with 200,000 lumens would have an illuminance of ~15,000 (ignoring beam reflections) | ||
// | ||
// default | ||
// for point/spotlights: 10,000 | ||
// for global directional light: depends on explorer implementation. may vary on light direction, time of day, etc | ||
optional float illuminance = 2; | ||
// whether the light should cast shadows. | ||
// note: even when set to true the engine may not display shadows, or may only show shadows for a limited number | ||
// of lights depending on the implementation, platform, and user settings. | ||
// default | ||
// for point/spotlights: false / off | ||
// for global directional light: true / on | ||
optional bool shadows = 3; | ||
// light color | ||
// default White | ||
optional decentraland.common.Color3 color = 4; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
syntax = "proto3"; | ||
package decentraland.sdk.components; | ||
|
||
import "decentraland/sdk/components/common/id.proto"; | ||
option (common.ecs_component_id) = 1205; | ||
|
||
// defines a spotlight. | ||
// spotlights are point lights that emit light only in a cone around the transform's forward direction. | ||
// add this component together with the PBLight component to transform a point light into a spotlight. | ||
// note that spotlights do not model any internal reflections / focus, they only restrict the area of effect. | ||
// so for e.g. a torch beam, the bulb illuminance should be multiplied by the solid angle. | ||
// a typical torch with a beam width of 15 degrees would use outer angle of 0.15 (7.5 degrees in radians), | ||
// and an illuminance approximately equal to the bulb's lumens, e.g. 1200. | ||
message PBSpotlight { | ||
// the cone radius in radians. distance away from forward in which the light is visible. | ||
// for a torch a value around 0.15 is appropriate. | ||
float angle = 1; | ||
// optional angle at which the light is brightest. should be <= outer angle. | ||
// if specified, the light will fall off smoothly between `inner_angle` and `angle`. | ||
optional float inner_angle = 2; | ||
} |