-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #106 from galacean/feat/2.1
Merge origin/feat/2.1 into origin/main
- Loading branch information
Showing
59 changed files
with
1,060 additions
and
543 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,2 @@ | ||
engine-strict=true | ||
enable-pre-post-scripts=true |
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
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,106 @@ | ||
import type { RenderLevel } from './type'; | ||
|
||
/** | ||
* 资源基类 | ||
*/ | ||
export interface AssetBase { | ||
/** | ||
* 资源 ID | ||
*/ | ||
id: string, | ||
/** | ||
* 资源类型 | ||
*/ | ||
url: string, | ||
/** | ||
* 渲染等级 | ||
* 如果没有设置,按照 B+ 处理 | ||
*/ | ||
renderLevel?: RenderLevel, | ||
} | ||
|
||
/** | ||
* 动态换图类型 | ||
* @since 1.1.0 | ||
*/ | ||
export enum BackgroundType { | ||
video = 'video', | ||
image = 'image', | ||
} | ||
|
||
/** | ||
* 多媒体资源类型 | ||
* @since 2.1.0 | ||
*/ | ||
export enum MultimediaType { | ||
video = 'video', | ||
audio = 'audio', | ||
} | ||
|
||
export interface TemplateContent { | ||
/** | ||
* 当 template 宽高和 image 不相同时,会对 template 进行缩放,使其和 image 相同。 | ||
*/ | ||
width: number, | ||
height: number, | ||
// 绘制 canvas 的背景图片,替换掉原来的那张图片,如果没有就不替换 | ||
background?: { | ||
type: BackgroundType, | ||
name: string, | ||
url: string | HTMLImageElement, | ||
}, | ||
} | ||
|
||
export type TemplateVariables = Record<string, string | string[] | HTMLImageElement | HTMLImageElement[]>; | ||
|
||
export type ImageSource = Image | TemplateImage | CompressedImage; | ||
|
||
/** | ||
* 纹理贴图属性 | ||
*/ | ||
export interface Image extends AssetBase { | ||
/** | ||
* WebP 地址 | ||
* 如果运行时支持 WebP,则优先使用 WebP | ||
*/ | ||
webp?: string, | ||
/** | ||
* AVIF 地址 | ||
* 如果运行时支持 AVIF,则优先使用 AVIF | ||
* @since 2.0.0 | ||
*/ | ||
avif?: string, | ||
/** | ||
* 是否使用 mipmap | ||
* loader 发布压缩纹理的时候会根据此参数决定是否生成压缩纹理 | ||
* @default false | ||
*/ | ||
mipmap?: boolean, | ||
/** | ||
* 图片 Y 轴的方向,如果 Y 轴向上(与 OpenGL 相同)则为 1 | ||
* 如果 Y 轴向下(与 OpenGL 相反)则为 -1,图片再绘制数据模板的时候需要翻转绘制 | ||
* @default 1 | ||
*/ | ||
oriY?: 1 | -1, | ||
} | ||
|
||
/** | ||
* 模板贴图属性 | ||
*/ | ||
export interface TemplateImage extends Image { | ||
template: TemplateContent, | ||
} | ||
|
||
/** | ||
* 压缩贴图属性 | ||
*/ | ||
export interface CompressedImage extends Image { | ||
/** | ||
* 压缩贴图地址 | ||
*/ | ||
compressed: { | ||
// 安卓 | ||
astc?: string, | ||
pvrtc?: string, | ||
}, | ||
} |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export const BuiltinObjectGUID = { | ||
WhiteTexture: 'whitetexture00000000000000000000', | ||
TransparentTexture: 'transparenttexture00000000000000000000', | ||
PBRShader: 'pbr00000000000000000000000000000', | ||
UnlitShader: 'unlit000000000000000000000000000', | ||
}; |
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,9 @@ | ||
import type { EffectsObjectData } from '../effects-object-data'; | ||
|
||
export interface DataPath { | ||
id: string, | ||
} | ||
|
||
export interface ComponentData extends EffectsObjectData { | ||
item: DataPath, | ||
} |
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,2 @@ | ||
export * from './component-data'; | ||
export * from './post-process-volume-data'; |
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,45 @@ | ||
import type { ComponentData } from './component-data'; | ||
|
||
export interface PostProcessVolumeData extends ComponentData { | ||
/** | ||
* 泛光 | ||
*/ | ||
bloom?: Bloom, | ||
/** | ||
* 颜色调整 | ||
*/ | ||
colorAdjustments?: ColorAdjustments, | ||
/** | ||
* 晕影 | ||
*/ | ||
vignette?: Vignette, | ||
/** | ||
* 色调映射 | ||
*/ | ||
tonemapping?: Tonemapping, | ||
} | ||
|
||
export interface PostProcessEffectSettings { | ||
active: boolean, | ||
} | ||
|
||
export interface Bloom extends PostProcessEffectSettings { | ||
threshold: number, | ||
intensity: number, | ||
} | ||
|
||
export interface Tonemapping extends PostProcessEffectSettings { | ||
|
||
} | ||
|
||
export interface ColorAdjustments extends PostProcessEffectSettings { | ||
brightness: number, | ||
saturation: number, | ||
contrast: number, | ||
} | ||
|
||
export interface Vignette extends PostProcessEffectSettings { | ||
intensity: number, | ||
smoothness: number, | ||
roundness: number, | ||
} |
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,8 @@ | ||
import type { BezierValue } from '../number-expression'; | ||
|
||
export type ColorCurveData = [ | ||
r: BezierValue, | ||
g: BezierValue, | ||
b: BezierValue, | ||
a: BezierValue, | ||
]; |
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,2 @@ | ||
export * from './color-curve-data'; | ||
export * from './vector4-curve-data'; |
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,8 @@ | ||
import type { BezierValue } from '../number-expression'; | ||
|
||
export type Vector4CurveData = [ | ||
x: BezierValue, | ||
y: BezierValue, | ||
z: BezierValue, | ||
w: BezierValue, | ||
]; |
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,53 @@ | ||
export enum DataType { | ||
VFXItemData = 'VFXItemData', | ||
EffectComponent = 'EffectComponent', | ||
Material = 'Material', | ||
Shader = 'Shader', | ||
SpriteComponent = 'SpriteComponent', | ||
ParticleSystem = 'ParticleSystem', | ||
InteractComponent = 'InteractComponent', | ||
CameraController = 'CameraController', | ||
PostProcessVolume = 'PostProcessVolume', | ||
Geometry = 'Geometry', | ||
Texture = 'Texture', | ||
Image = 'Image', | ||
AnimationClip = 'AnimationClip', | ||
TextComponent = 'TextComponent', | ||
BinaryAsset = 'BinaryAsset', | ||
|
||
// Timeline | ||
TrackAsset = 'TrackAsset', | ||
TimelineAsset = 'TimelineAsset', | ||
ObjectBindingTrack = 'ObjectBindingTrack', | ||
TransformTrack = 'TransformTrack', | ||
SpriteColorTrack = 'SpriteColorTrack', | ||
ActivationTrack = 'ActivationTrack', | ||
SubCompositionTrack = 'SubCompositionTrack', | ||
FloatPropertyTrack = 'FloatPropertyTrack', | ||
ColorPropertyTrack = 'ColorPropertyTrack', | ||
Vector4PropertyTrack = 'Vector4PropertyTrack', | ||
|
||
TransformPlayableAsset = 'TransformPlayableAsset', | ||
SpriteColorPlayableAsset = 'SpriteColorPlayableAsset', | ||
ActivationPlayableAsset = 'ActivationPlayableAsset', | ||
SubCompositionPlayableAsset = 'SubCompositionPlayableAsset', | ||
FloatPropertyPlayableAsset = 'FloatPropertyPlayableAsset', | ||
ColorPropertyPlayableAsset = 'ColorPropertyPlayableAsset', | ||
|
||
MeshComponent = 'MeshComponent', | ||
SkyboxComponent = 'SkyboxComponent', | ||
LightComponent = 'LightComponent', | ||
CameraComponent = 'CameraComponent', | ||
ModelPluginComponent = 'ModelPluginComponent', | ||
TreeComponent = 'TreeComponent', | ||
AnimationComponent = 'AnimationComponent', | ||
SpineComponent = 'SpineComponent', | ||
VideoComponent = 'VideoComponent', | ||
AudioComponent = 'AudioComponent', | ||
RichTextComponent = 'RichTextComponent', | ||
OrientationComponent = 'OrientationComponent', | ||
ShapeComponent = 'ShapeComponent', | ||
|
||
// Non-EffectObject | ||
TimelineClip = 'TimelineClip', | ||
} |
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,7 @@ | ||
import type { DataType } from './data-type'; | ||
|
||
export interface EffectsObjectData { | ||
id: string, | ||
name?: string, | ||
dataType: DataType, | ||
} |
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,11 @@ | ||
import type { EffectsObjectData } from './effects-object-data'; | ||
|
||
export interface EffectsPackageData { | ||
fileSummary: FileSummary, | ||
exportObjects: EffectsObjectData[], | ||
} | ||
|
||
export interface FileSummary { | ||
guid: string, | ||
assetType: string, | ||
} |
Oops, something went wrong.