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.

5.0 KB
Raw Blame
{
  "version": 4,
  "name": "Planar Reflection",
  "entities": [
    {
      "id": 1,
      "name": "Camera",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "position": {
              "x": 0,
              "y": 3,
              "z": 6
            },
            "rotation": {
              "x": -0.22975292,
              "y": 0,
              "z": 0,
              "w": 0.97324899
            }
          }
        },
        {
          "type": "Camera",
          "data": {
            "projectionType": 1,
            "orthoSize": 6,
            "isActive": true,
            "clearFlags": 3,
            "nearPlane": 0.1,
            "farPlane": 100
          }
        }
      ]
    },
    {
      "id": 2,
      "name": "Mirror",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "rotation": {
              "x": -0.70710678,
              "y": 0,
              "z": 0,
              "w": 0.70710678
            },
            "scale": {
              "x": 7,
              "y": 7,
              "z": 1
            }
          }
        },
        {
          "type": "MeshRenderer",
          "data": {
            "mesh": "/scenes/shadow-quad.esmesh",
            "material": "/scenes/mat-planar/mirror.esmaterial",
            "opaque": true,
            "lit": true,
            "enabled": true
          }
        },
        {
          "type": "PlanarReflection",
          "data": {
            "axis": 2,
            "quality": 1,
            "resolutionScale": 1,
            "maxSize": 512,
            "enabled": true
          }
        }
      ]
    },
    {
      "id": 3,
      "name": "Red",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "position": {
              "x": -1.3,
              "y": 1,
              "z": 0
            },
            "scale": {
              "x": 0.01,
              "y": 0.01,
              "z": 0.01
            }
          }
        },
        {
          "type": "MeshRenderer",
          "data": {
            "mesh": "builtin:cube",
            "opaque": true,
            "cullBackfaces": true,
            "lit": false,
            "layer": 1,
            "color": {
              "r": 1,
              "g": 0,
              "b": 0,
              "a": 1
            }
          }
        }
      ]
    },
    {
      "id": 4,
      "name": "Green",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "position": {
              "x": 1.3,
              "y": 0.7,
              "z": -0.8
            },
            "scale": {
              "x": 0.007,
              "y": 0.007,
              "z": 0.007
            }
          }
        },
        {
          "type": "MeshRenderer",
          "data": {
            "mesh": "builtin:cube",
            "opaque": true,
            "cullBackfaces": true,
            "lit": false,
            "layer": 2,
            "color": {
              "r": 0,
              "g": 1,
              "b": 0,
              "a": 1
            }
          }
        }
      ]
    },
    {
      "id": 5,
      "name": "Below plane",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "position": {
              "x": 0,
              "y": -1,
              "z": 0
            },
            "scale": {
              "x": 0.007,
              "y": 0.007,
              "z": 0.007
            }
          }
        },
        {
          "type": "MeshRenderer",
          "data": {
            "mesh": "builtin:cube",
            "opaque": true,
            "lit": false,
            "color": {
              "r": 0,
              "g": 0,
              "b": 1,
              "a": 1
            }
          }
        }
      ]
    },
    {
      "id": 6,
      "name": "Second camera",
      "parent": null,
      "children": [],
      "visible": true,
      "components": [
        {
          "type": "Transform",
          "data": {
            "position": {
              "x": 1.5,
              "y": 3,
              "z": 6
            },
            "rotation": {
              "x": -0.22975292,
              "y": 0,
              "z": 0,
              "w": 0.97324899
            }
          }
        },
        {
          "type": "Camera",
          "data": {
            "projectionType": 1,
            "orthoSize": 6,
            "isActive": false,
            "clearFlags": 3,
            "nearPlane": 0.1,
            "farPlane": 100,
            "priority": 1,
            "viewport": {
              "x": 0.5,
              "y": 0,
              "z": 0.5,
              "w": 1
            }
          }
        }
      ]
    }
  ]
}