Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(main branch) protocol squad #202

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
b07ee40
cinematic camera
robtfm May 14, 2024
57932cf
typo
robtfm May 15, 2024
59775b1
separate avatar controls
robtfm May 15, 2024
4b60fac
separate message for movement settings
robtfm May 15, 2024
724358e
add ui fields
robtfm May 15, 2024
1e423c0
add collider range
robtfm May 16, 2024
17018eb
Merge branch 'main' into cinecam
leanmendoza May 17, 2024
57842f7
publish a protocol-squad version
leanmendoza May 17, 2024
ae49e5c
add text_wrapping
leanmendoza May 27, 2024
3fd5a50
Merge branch 'main' into protocol-squad
leanmendoza Jun 19, 2024
5243189
feat: add scroll result component for scrolling ui transform
leanmendoza Jun 26, 2024
9d2fa3c
remove boolean text wrapping
leanmendoza Jun 26, 2024
61ce678
gltf node (#207)
leanmendoza Jul 30, 2024
3869a88
Merge branch 'main' into protocol-squad
leanmendoza Jul 30, 2024
e0cda12
Merge branch 'main' into protocol-squad
leanmendoza Aug 5, 2024
205bdd8
Merge branch 'main' into protocol-squad
leanmendoza Aug 5, 2024
acd1db5
use 1200 ids
leanmendoza Aug 13, 2024
0207676
in-world UI (#212)
leanmendoza Sep 18, 2024
f199bbd
lights initial (#217)
leanmendoza Sep 18, 2024
8a6cf9b
Merge branch 'main' into protocol-squad
leanmendoza Sep 18, 2024
471b772
Merge branch 'main' into protocol-squad
leanmendoza Oct 24, 2024
26045c5
Merge branch 'main' into protocol-squad
leanmendoza Nov 15, 2024
b277a0c
Merge branch 'main' into protocol-squad
leanmendoza Dec 3, 2024
27241f4
feat: ui transform - add z index (#232)
leanmendoza Dec 19, 2024
591a12f
Merge branch 'main' into protocol-squad
leanmendoza Dec 19, 2024
fdbbfb3
feat: render to texture (#236)
leanmendoza Jan 27, 2025
a7ca443
feat: pointer position and drag (#237)
robtfm Jan 27, 2025
ea9043b
build and publish
kuruk-mm Jan 27, 2025
c95848f
Merge branch 'main' into protocol-squad
leanmendoza Feb 1, 2025
5dc030d
test
leanmendoza Feb 1, 2025
7264662
test
leanmendoza Feb 1, 2025
b71756b
test
leanmendoza Feb 1, 2025
a130978
test
leanmendoza Feb 1, 2025
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
23 changes: 15 additions & 8 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ on:
push:
branches:
- main
- protocol-squad
- experimental
pull_request:
release:
types:
- created

env:
BRANCH_TAG: ${{ github.ref_name == 'experimental' && 'experimental' || '' }}
env:
IS_A_PR: ${{ github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad' }}

name: build-deploy
jobs:
Expand All @@ -21,6 +21,13 @@ jobs:
outputs:
dcl_protocol_s3_bucket_key: ${{ steps.publish_dcl_protocol.outputs.s3-bucket-key }}
steps:
- name: (PR) Check if it's a PR
if: ${{ env.IS_A_PR == 'true' }}
run: |
echo "run from a PR"
echo "from env '${{env.IS_A_PR}}'"
echo "- '${{github.event.pull_request.number}}'"
echo "- env '${{github.head_ref}}'"
- uses: actions/checkout@v4
- name: install
run: make install
Expand All @@ -32,6 +39,8 @@ jobs:
uses: menduz/oddish-action@master
id: publish_dcl_protocol
with:
custom-tag: protocol-squad
branch-to-custom-tag: protocol-squad
registry-url: 'https://registry.npmjs.org'
access: public
## use action runId instead of current date to generate snapshot numbers
Expand All @@ -47,18 +56,16 @@ jobs:
## inform gitlab after publishing to proceed with CDN propagation
gitlab-token: ${{ secrets.GITLAB_TOKEN }}
gitlab-pipeline-url: ${{ secrets.GITLAB_URL }}
custom-tag: ${{ env.BRANCH_TAG }}
branch-to-custom-tag: ${{ env.BRANCH_TAG }}
env:
BRANCH_NAME: ${{ github.ref_name }}
BRANCH_NAME: ${{ github.head_ref }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
AWS_DEFAULT_REGION: us-east-1
AWS_ACCESS_KEY_ID: ${{ secrets.SDK_TEAM_AWS_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.SDK_TEAM_AWS_SECRET }}

notify_deployment:
needs: [check_and_build]
if: ${{ github.event.pull_request.number }}
needs: [check_and_build]
if: github.event.pull_request.number != 'null' && github.head_ref != 'protocol-squad'
runs-on: ubuntu-latest
name: Deployment Notification
steps:
Expand Down
9 changes: 8 additions & 1 deletion proto/decentraland/common/texture.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,17 @@ message VideoTexture {
optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
}

message UiCanvasTexture {
uint32 ui_canvas_entity = 1;
optional TextureWrapMode wrap_mode = 2; // default = TextureWrapMode.Clamp
optional TextureFilterMode filter_mode = 3; // default = FilterMode.Bilinear
}

message TextureUnion {
oneof tex {
Texture texture = 1; // default = null
AvatarTexture avatar_texture = 2; // default = null
VideoTexture video_texture = 3; // default = null
UiCanvasTexture ui_texture = 4;
}
}
}
21 changes: 21 additions & 0 deletions proto/decentraland/sdk/components/avatar_modifier_area.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,31 @@ message PBAvatarModifierArea {
decentraland.common.Vector3 area = 1; // the 3D size of the region
repeated string exclude_ids = 2; // user IDs that can enter and remain unaffected
repeated AvatarModifierType modifiers = 3; // list of modifiers to apply
optional AvatarMovementSettings movement_settings = 4;
optional bool use_collider_range = 5; // if true, the player will be considered inside the area when they are within 0.3m of the area. default true
}

// AvatarModifierType is an effect that should be applied to avatars inside the region.
enum AvatarModifierType {
AMT_HIDE_AVATARS = 0; // avatars are invisible
AMT_DISABLE_PASSPORTS = 1; // selecting (e.g. clicking) an avatar will not bring up their profile.
}

message AvatarMovementSettings {
optional AvatarControlType control_mode = 1;
// if not explicitly set, the following properties default to user's preference settings
optional float run_speed = 2; // speed the player moves at, in m/s
optional float friction = 3; // how fast the player gets up to speed or comes to rest. higher = more responsive
optional float gravity = 4; // how fast the player accelerates vertically when not on a solid surface, in m/s. should normally be negative
optional float jump_height = 5; // how high the player can jump, in meters. should normally be positive. gravity must have the same sign for jumping to be possible
optional float max_fall_speed = 6; // max fall speed in m/s. should normally be negative
optional float turn_speed = 7; // speed the player turns in tank mode, in radians/s
optional float walk_speed = 8; // speed the player walks at, in m/s
optional bool allow_weighted_movement = 9; // whether to allow player to move at a slower speed (e.g. with a walk-key or when using a gamepad/joystick). defaults to true
}

enum AvatarControlType {
CCT_NONE = 0; // avatar cannot move
CCT_RELATIVE = 1; // avatar moves relative to the camera origin
CCT_TANK = 2; // avatar moves like a tank: left/right rotate the player, forward/backward advance/retreat the player
}
30 changes: 30 additions & 0 deletions proto/decentraland/sdk/components/camera_layer.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
syntax = "proto3";

package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";
import "decentraland/common/colors.proto";

option (common.ecs_component_id) = 1210;

message PBCameraLayer {
// layer to which these settings apply. must be > 0
// Layer 0 is the default "real world" layer viewed by the player and cannot be modified.
uint32 layer = 1;

// should the sun light affect this layer? default false
optional bool directional_light = 2;

// should this layer show player avatars? default false
optional bool show_avatars = 3;

// should this layer show the sky? default false
optional bool show_skybox = 4;

// should this layer show distance fog? default false
optional bool show_fog = 5;

// ambient light overrides for this layer. default -> use same as main camera
optional decentraland.common.Color3 ambient_color_override = 6;
optional float ambient_brightness_override = 7;
}
11 changes: 11 additions & 0 deletions proto/decentraland/sdk/components/camera_layers.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
syntax = "proto3";

package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";

option (common.ecs_component_id) = 1208;

message PBCameraLayers {
repeated uint32 layers = 1;
}
25 changes: 22 additions & 3 deletions proto/decentraland/sdk/components/camera_mode_area.proto
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import "decentraland/sdk/components/common/id.proto";
option (common.ecs_component_id) = 1071;

// The CameraModeArea component can be attached to an Entity to define a region of space where
// the player's camera mode (1st-person or 3rd-person) is overridden.
// the player's camera mode (1st-person, 3rd-person or cinematic) is overridden.
//
// The Entity's Transform position determines the center-point of the region, while its size is
// given as a vector in the `area` property below. The Transform rotation is applied, but the scale
Expand All @@ -19,7 +19,26 @@ option (common.ecs_component_id) = 1071;
//
// Note that, while commonly used to delineate a 2D area in a scene (hence the name), the region
// is actually a 3D volume.
//
// When mode is set to CtCinematic, the cinematic_settings field must also be provided.
message PBCameraModeArea {
decentraland.common.Vector3 area = 1; // the 3D size of the region
common.CameraType mode = 2; // the camera mode to enforce
decentraland.common.Vector3 area = 1; // the 3D size of the region
common.CameraType mode = 2; // the camera mode to enforce
optional CinematicSettings cinematic_settings = 3;
optional bool use_collider_range = 4; // if true, the player will be considered inside the area when they are within 0.3m of the area. default true
}

message CinematicSettings {
uint32 camera_entity = 1; // Entity that defines the cinematic camera transform.
// Position -> camera's position
// Rotation -> camera's direction
// scale.z -> zoom level
// scale.x and scale.y -> unused
optional bool allow_manual_rotation = 2; // whether the user can move the camera's rotation. default false
optional float yaw_range = 3; // how far the camera can rotate around the y-axis / look left/right, in radians. default unrestricted
optional float pitch_range = 4; // how far the camera can rotate around the x-axis / look up-down, in radians. default unrestricted
// note: cameras can never look up/down further than Vec3::Y
optional float roll_range = 5; // how far the camera can rotate around the z-axis / tilt, in radians. default unrestricted
optional float zoom_min = 6; // minimum zoom level. must be greater than 0. defaults to the input zoom level
optional float zoom_max = 7; // maximum zoom level. must be greater than 0. defaults to the input zoom level
}
3 changes: 3 additions & 0 deletions proto/decentraland/sdk/components/common/input_action.proto
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ enum PointerEventType {
PET_DOWN = 1;
PET_HOVER_ENTER = 2;
PET_HOVER_LEAVE = 3;
PET_DRAG_LOCKED = 4;
PET_DRAG = 5;
PET_DRAG_END = 6;
}
22 changes: 22 additions & 0 deletions proto/decentraland/sdk/components/global_light.proto
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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,17 @@ import "decentraland/sdk/components/common/loading_state.proto";
// the current state of the GltfContainer of an entity.
message PBGltfContainerLoadingState {
common.LoadingState current_state = 1;
repeated string node_paths = 2; // all node paths in the gltf, which can be used with a GltfNode to inspect and modify the gltf contents
repeated string mesh_names = 3; // all meshes in the gltf. unnamed meshes will be auto-assigned a name of the form `MeshX` or `MeshX/PrimitiveY`
// where X is the mesh index and Y is the primitive index (and there is more than 1 primitive). note this may
// conflict with manually named meshes - to avoid any issues make sure all your meshes are explicitly named.
repeated string material_names = 4; // all materials in the gltf. unnamed materials will be auto-assigned a name of the form `MaterialX` where
// X is the material index. note this may conflict with manually named materials - to avoid any issues make
// sure all your materials are explicitly named.
repeated string skin_names = 5; // all mesh skins in the gltf. unnamed skins will be auto-assigned a name of the form `SkinX` where
// X is the skin index. note this may conflict with manually named skins - to avoid any issues make sure all
// your skins are explicitly named.
repeated string animation_names = 6; // all animations in the gltf. unnamed animations will be auto-assigned a name of the form `AnimationX` where
// X is the animation index. note this may conflict with manually named anims - to avoid any issues make sure all
// your animations are explicitly named.
}
42 changes: 42 additions & 0 deletions proto/decentraland/sdk/components/gltf_node.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
syntax = "proto3";
package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";
option (common.ecs_component_id) = 1200;

// a GltfNode links a scene entity with a node from within a gltf, allowing the scene to inspect it or modify it.
// This component must be added to a direct child of an entity with a PBGltfContainer component, or
// to a direct child of another entity with a GltfNode component, and the referenced gltf node must be a descendent of the gltf node
// in the parent.
// The name must match the path of one of the nodes within the Gltf. These are available on the GltfContainerLoadingState component.
//
// The renderer will attach a PBGltfNodeState to the entity describing the state. Once the state is `GNS_READY`,
// - the `Transform` will be updated to match the position of the node within the gltf (relative to the gltf root, or the parent node),
// - a `MeshRenderer` with a GltfMesh mesh type will be added (if the gltf node has a mesh).
// - a `MeshCollider` with a GltfMesh mesh type will be added (if the gltf node has a collider).
// - a `Material` component including a GltfMaterial reference will be added (if the gltf node has a material).
//
// After creation, if an animation moves the node, the `Transform` will be updated.
//
// From the scene, you can modify various components to alter the gltf node:
// - modifying the `Transform` position/rotation/scale will move the node. The position is interpreted relative to the gltf root (or parent node),
// regardless of any intermediate gltf node hierarchy.
// If an animation is playing, the animation takes priority and the scene entity's position will be updated to match the animation.
// - `Visibility` can be added to hide or show the node and it's children in the gltf hierarchy.
// - `MeshRenderer` can be added/modified/removed to create/modify/remove a mesh on the node.
// - `MeshCollider` can be added/modified/removed to create/modify/remove a collider on the node.
// - `Material` can be added or modified to change the material properties. If the gltf node has a material, the original material will be
// used as a base, and any gltf features (e.g. occlusion maps) from the gtlf spec that the renderer supports but that are not exposed in the
// PBMaterial will be maintained.
//
// The scene can add additional entities as children to the gltf node, but structural modifications of the gltf are not possible:
// - changing the scene hierarchy will not change the gltf node hierarchy. Moving the entity out of the gltf will sever the link and
// change the state to `GNS_FAILED`.
// - deleting the scene entity will not delete the gltf node.
//
// Removing the GltfNode will revert any changes to the original gltf. If the GltfNode component is removed and the mesh/collider/material
// are not removed, this will result in a duplication of these components as the previously-linked entity will retain it's components and
// the gltf node will also be displayed.
message PBGltfNode {
string path = 1; // the path of the target node in the Gltf.
}
20 changes: 20 additions & 0 deletions proto/decentraland/sdk/components/gltf_node_state.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
syntax = "proto3";
package decentraland.sdk.components;

import "decentraland/sdk/components/common/id.proto";
option (common.ecs_component_id) = 1201;

// See the details of the GltfNode component for more information.

// The state of a linked gltf node.
// If the state is GNSV_FAILED, the renderer may describe the failure in the error string.
message PBGltfNodeState {
GltfNodeStateValue state = 1;
optional string error = 2;
}

enum GltfNodeStateValue {
GNSV_PENDING = 0;
GNSV_FAILED = 1;
GNSV_READY = 2;
}
42 changes: 42 additions & 0 deletions proto/decentraland/sdk/components/light.proto
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;
}
14 changes: 13 additions & 1 deletion proto/decentraland/sdk/components/material.proto
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,16 @@ message PBMaterial {
UnlitMaterial unlit = 1;
PbrMaterial pbr = 2;
}
}

message GltfMaterial {
string gltf_src = 1;
string name = 2;
}

// A gltf material that may provide additional features not supported by the PbMaterial fields.
// If both gltf and material fields are provided, the gltf will be used only for extended features not
// supported by the PbMaterial.
// If this is provided and the `material` field is not provided, the renderer will update the material
// field with data that reflects the gltf material once it is loaded.
optional GltfMaterial gltf = 3;
}
Loading
Loading