Skip to content

A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.

feat(render): the Eye shader takes a lid shadow, authored or from the surface facing up

yhh4966d4206a22
diff --git a/fixtures/scenes/eye-lid.esscene b/fixtures/scenes/eye-lid.esscene
new file mode 100644
index 000000000..47bc29b57
--- /dev/null
+++ b/fixtures/scenes/eye-lid.esscene
@@ -0,0 +1,171 @@
+{
+ "version": 4,
+ "name": "EyeLid",
+ "entities": [
+ {
+ "id": 0,
+ "name": "Camera",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 10,
+ "z": 0
+ },
+ "rotation": {
+ "x": -0.7071067811865476,
+ "y": 0,
+ "z": 0,
+ "w": 0.7071067811865476
+ }
+ }
+ },
+ {
+ "type": "Camera",
+ "data": {
+ "projectionType": 1,
+ "orthoSize": 300,
+ "isActive": true,
+ "priority": 0
+ }
+ }
+ ]
+ },
+ {
+ "id": 1,
+ "name": "Off",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": -150,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 250,
+ "y": 250,
+ "z": 1
+ },
+ "rotation": {
+ "x": -0.7071067811865476,
+ "y": 0,
+ "z": 0,
+ "w": 0.7071067811865476
+ }
+ }
+ },
+ {
+ "type": "MeshRenderer",
+ "data": {
+ "mesh": "/scenes/shadow-quad.esmesh",
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "lit": true,
+ "opaque": true,
+ "enabled": true,
+ "material": "/scenes/eye-lid/off.esmaterial"
+ }
+ }
+ ]
+ },
+ {
+ "id": 2,
+ "name": "On",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 150,
+ "y": 0,
+ "z": 0
+ },
+ "scale": {
+ "x": 250,
+ "y": 250,
+ "z": 1
+ },
+ "rotation": {
+ "x": -0.7071067811865476,
+ "y": 0,
+ "z": 0,
+ "w": 0.7071067811865476
+ }
+ }
+ },
+ {
+ "type": "MeshRenderer",
+ "data": {
+ "mesh": "/scenes/shadow-quad.esmesh",
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "lit": true,
+ "opaque": true,
+ "enabled": true,
+ "material": "/scenes/eye-lid/on.esmaterial"
+ }
+ }
+ ]
+ },
+ {
+ "id": 3,
+ "name": "Sun",
+ "parent": null,
+ "children": [],
+ "visible": true,
+ "components": [
+ {
+ "type": "Transform",
+ "data": {
+ "position": {
+ "x": 0,
+ "y": 0,
+ "z": 0
+ },
+ "rotation": {
+ "x": -0.7071067811865476,
+ "y": 0,
+ "z": 0,
+ "w": 0.7071067811865476
+ }
+ }
+ },
+ {
+ "type": "Light",
+ "data": {
+ "type": 1,
+ "color": {
+ "r": 1,
+ "g": 1,
+ "b": 1,
+ "a": 1
+ },
+ "intensity": 0.35,
+ "meshShadows": false
+ }
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/fixtures/scenes/eye-lid/off.esmaterial b/fixtures/scenes/eye-lid/off.esmaterial
new file mode 100644
index 000000000..ad0abf41c
--- /dev/null
+++ b/fixtures/scenes/eye-lid/off.esmaterial
@@ -0,0 +1,13 @@
+{
+ "version": "1.0",
+ "type": "material",
+ "shader": "builtin:eye",
+ "blendMode": 0,
+ "depthTest": true,
+ "depthWrite": true,
+ "cull": 0,
+ "properties": {
+ "u_lidShadow": 0,
+ "u_lidStart": 0.2
+ }
+}
\ No newline at end of file
diff --git a/fixtures/scenes/eye-lid/on.esmaterial b/fixtures/scenes/eye-lid/on.esmaterial
new file mode 100644
index 000000000..356785066
--- /dev/null
+++ b/fixtures/scenes/eye-lid/on.esmaterial
@@ -0,0 +1,13 @@
+{
+ "version": "1.0",
+ "type": "material",
+ "shader": "builtin:eye",
+ "blendMode": 0,
+ "depthTest": true,
+ "depthWrite": true,
+ "cull": 0,
+ "properties": {
+ "u_lidShadow": 0.6,
+ "u_lidStart": 0.2
+ }
+}
\ No newline at end of file