Skip to content

Commit

Permalink
feat(engine): update wonder.js version
Browse files Browse the repository at this point in the history
  • Loading branch information
yyc-git committed Jan 18, 2019
1 parent b40eff5 commit 39abfae
Show file tree
Hide file tree
Showing 36 changed files with 364 additions and 138 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
"wonder-bs-most": "^0.0.3",
"wonder-commonlib": "0.2.23",
"wonder-log": "^0.2.10",
"wonder.js": "1.0.0-alpha.24.1"
"wonder.js": "1.0.0-alpha.24.2"
},
"resolutions": {
"wonder-log": "^0.2.10",
"wonder-webgl": "^0.0.5",
"wonder-webgl": "^0.0.6",
"wonder-bs-sinon": "0.1.7",
"component-classes": "1.2.5",
"wonder-commonlib": "0.2.23",
Expand Down
3 changes: 3 additions & 0 deletions publish/config/no_worker/job/init_jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
{
"name": "init_state"
},
{
"name": "init_no_material_shader"
},
{
"name": "init_basic_material"
},
Expand Down
3 changes: 3 additions & 0 deletions publish/config/no_worker/job/loop_jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@
{
"name": "reallocate_cpu_memory"
},
{
"name": "draw_outline"
},
{
"name": "render_imgui"
}
Expand Down
3 changes: 3 additions & 0 deletions publish/config/no_worker/pipeline/init_pipelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
{
"name": "init_state"
},
{
"name": "init_no_material_shader"
},
{
"name": "init_basic_material"
},
Expand Down
3 changes: 3 additions & 0 deletions publish/config/no_worker/pipeline/loop_pipelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
{
"name": "front_render_light"
},
{
"name": "draw_outline"
},
{
"name": "render_imgui"
}
Expand Down
55 changes: 55 additions & 0 deletions publish/config/render/shader/shader_libs.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,61 @@
}
]
},
{
"name": "outline_expand",
"glsls": [
{
"type": "vs",
"name": "webgl1_outline_expand_vertex"
},
{
"type": "fs",
"name": "webgl1_outline_expand_fragment"
}
],
"variables": {
"uniforms": [
{
"name": "u_outlineColor",
"from": "no_material_shader",
"field": "outlineExpand",
"type": "float3"
}
]
}
},
{
"name": "outline_scaled_modelMatrix",
"glsls": [
{
"type": "vs",
"name": "modelMatrix_noInstance_vertex"
}
],
"variables": {
"uniforms": [
{
"name": "u_mMatrix",
"field": "mMatrix",
"type": "mat4",
"from": "expand_model"
}
]
}
},
{
"name": "outline_origin",
"glsls": [
{
"type": "vs",
"name": "webgl1_outline_origin_vertex"
},
{
"type": "fs",
"name": "webgl1_outline_origin_fragment"
}
]
},
{
"name": "end",
"variables": {
Expand Down
43 changes: 43 additions & 0 deletions publish/config/render/shader/shaders.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,5 +154,48 @@
}
]
}
],
"no_material_shaders": [
{
"name": "outline_draw_origin_gameObjects",
"shader_libs": [
{
"type": "group",
"name": "top"
},
{
"name": "modelMatrix_noInstance"
},
{
"name": "outline_origin"
},
{
"type": "group",
"name": "end"
}
]
},
{
"name": "outline_draw_expand_gameObjects",
"shader_libs": [
{
"type": "group",
"name": "top"
},
{
"name": "normal"
},
{
"name": "outline_scaled_modelMatrix"
},
{
"name": "outline_expand"
},
{
"type": "group",
"name": "end"
}
]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ let _init = allWDBGameObjectArrRef => {
let editorState = StateEditorService.getState();
let engineState = StateEngineService.unsafeGetState();

let engineState = engineState |> ShaderEngineService.clearShaderCache;
let engineState = engineState |> ShaderEngineService.clearInitShaderCache;

let engineState = _reInitDefaultMaterials(editorState, engineState);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ open InspectorComponentType;

module CustomEventHandler = {
include EmptyEventHandler.EmptyEventHandler;
type prepareTuple = Wonderjs.GameObjectType.gameObject;
type prepareTuple = Wonderjs.GameObjectPrimitiveType.gameObject;
type dataTuple = componentType;
type return = unit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open InspectorComponentType;

module CustomEventHandler = {
include EmptyEventHandler.EmptyEventHandler;
type prepareTuple = Wonderjs.GameObjectType.gameObject;
type prepareTuple = Wonderjs.GameObjectPrimitiveType.gameObject;
type dataTuple = componentType;
type return = unit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open Wonderjs;

type state = {
drawMode: Js.Typed_array.Uint8Array.elt,
meshRenderer: GameObjectType.gameObject,
meshRenderer: GameObjectPrimitiveType.gameObject,
};

type action =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open AppStore;

module CustomEventHandler = {
include EmptyEventHandler.EmptyEventHandler;
type prepareTuple = Wonderjs.GameObjectType.gameObject;
type prepareTuple = Wonderjs.GameObjectPrimitiveType.gameObject;
type dataTuple = string;
type return = unit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module CustomEventHandler = {

type prepareTuple = unit;
type dataTuple = (
Wonderjs.GameObjectType.gameObject,
Wonderjs.GameObjectType.gameObject,
Wonderjs.GameObjectPrimitiveType.gameObject,
Wonderjs.GameObjectPrimitiveType.gameObject,
);
type return = unit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ module CustomEventHandler = {

type prepareTuple = unit;
type dataTuple = (
Wonderjs.GameObjectType.gameObject,
Wonderjs.GameObjectType.gameObject,
Wonderjs.GameObjectPrimitiveType.gameObject,
Wonderjs.GameObjectPrimitiveType.gameObject,
);
type return = unit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ open UpdateStore;
module CustomEventHandler = {
include EmptyEventHandler.EmptyEventHandler;
type prepareTuple = unit;
type dataTuple = Wonderjs.GameObjectType.gameObject;
type dataTuple = Wonderjs.GameObjectPrimitiveType.gameObject;
type return = unit;

let handleSelfLogic = ((store, dispatchFunc), (), uid) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module CustomEventHandler = {
include EmptyEventHandler.EmptyEventHandler;

type prepareTuple = unit;
type dataTuple = Wonderjs.GameObjectType.gameObject;
type dataTuple = Wonderjs.GameObjectPrimitiveType.gameObject;
type return = unit;

let handleSelfLogic = ((store, dispatchFunc), (), wdbGameObjectUid) => {
Expand Down
3 changes: 3 additions & 0 deletions src/engine/config/no_worker/job/init_jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
{
"name": "init_state"
},
{
"name": "init_no_material_shader"
},
{
"name": "init_basic_material"
},
Expand Down
3 changes: 3 additions & 0 deletions src/engine/config/no_worker/job/loop_jobs.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@
{
"name": "render_imgui"
},
{
"name": "draw_outline"
},
{
"name": "prepare_render_scene_view"
},
Expand Down
3 changes: 3 additions & 0 deletions src/engine/config/no_worker/pipeline/init_pipelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
{
"name": "init_state"
},
{
"name": "init_no_material_shader"
},
{
"name": "init_basic_material"
},
Expand Down
3 changes: 3 additions & 0 deletions src/engine/config/no_worker/pipeline/loop_pipelines.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
{
"name": "front_render_light"
},
{
"name": "draw_outline"
},
{
"name": "render_imgui"
},
Expand Down
55 changes: 55 additions & 0 deletions src/engine/config/render/shader/shader_libs.json
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,61 @@
}
]
},
{
"name": "outline_expand",
"glsls": [
{
"type": "vs",
"name": "webgl1_outline_expand_vertex"
},
{
"type": "fs",
"name": "webgl1_outline_expand_fragment"
}
],
"variables": {
"uniforms": [
{
"name": "u_outlineColor",
"from": "no_material_shader",
"field": "outlineExpand",
"type": "float3"
}
]
}
},
{
"name": "outline_scaled_modelMatrix",
"glsls": [
{
"type": "vs",
"name": "modelMatrix_noInstance_vertex"
}
],
"variables": {
"uniforms": [
{
"name": "u_mMatrix",
"field": "mMatrix",
"type": "mat4",
"from": "expand_model"
}
]
}
},
{
"name": "outline_origin",
"glsls": [
{
"type": "vs",
"name": "webgl1_outline_origin_vertex"
},
{
"type": "fs",
"name": "webgl1_outline_origin_fragment"
}
]
},
{
"name": "end",
"variables": {
Expand Down
Loading

0 comments on commit 39abfae

Please sign in to comment.