UNPKG

seed-engine

Version:

A Lightweight 2D game engine using WebGL2. The engine is designed on the focus of creating a bridge between creating and publishing games to the Seed Network as modules.

426 lines 10.1 kB
{ "type": "File", "start": 0, "end": 371, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 20, "column": 1 } }, "program": { "type": "Program", "start": 0, "end": 371, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 20, "column": 1 } }, "sourceType": "module", "body": [ { "type": "ExportNamedDeclaration", "start": 92, "end": 371, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 20, "column": 1 } }, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", "start": 99, "end": 371, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 20, "column": 1 } }, "declarations": [ { "type": "VariableDeclarator", "start": 105, "end": 371, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 20, "column": 1 } }, "id": { "type": "Identifier", "start": 105, "end": 114, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 22 }, "identifierName": "DEFAULT_V" }, "name": "DEFAULT_V", "leadingComments": null }, "init": { "type": "TemplateLiteral", "start": 117, "end": 371, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 20, "column": 1 } }, "expressions": [], "quasis": [ { "type": "TemplateElement", "start": 118, "end": 370, "loc": { "start": { "line": 4, "column": 26 }, "end": { "line": 20, "column": 0 } }, "value": { "raw": "#version 300 es\n\n//in\nin vec2 a_position;\nin vec2 a_texcoord;\nuniform mat3 u_matrix;\nuniform float u_depth;\n\n\n//out\nout vec2 v_texcoord;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, u_depth, 1);\n v_texcoord = a_texcoord;\n}\n", "cooked": "#version 300 es\n\n//in\nin vec2 a_position;\nin vec2 a_texcoord;\nuniform mat3 u_matrix;\nuniform float u_depth;\n\n\n//out\nout vec2 v_texcoord;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, u_depth, 1);\n v_texcoord = a_texcoord;\n}\n" }, "tail": true } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Default vertex shader that handles 2D matricies (3x3 matricies) to screen space.\n ", "start": 0, "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ], "trailingComments": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * Default vertex shader that handles 2D matricies (3x3 matricies) to screen space.\n ", "start": 0, "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ] } ], "directives": [] }, "comments": [ { "type": "CommentBlock", "value": "*\n * Default vertex shader that handles 2D matricies (3x3 matricies) to screen space.\n ", "start": 0, "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } } ], "tokens": [ { "type": "CommentBlock", "value": "*\n * Default vertex shader that handles 2D matricies (3x3 matricies) to screen space.\n ", "start": 0, "end": 91, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 3, "column": 3 } } }, { "type": { "label": "export", "keyword": "export", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "export", "start": 92, "end": 98, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 6 } } }, { "type": { "label": "const", "keyword": "const", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "const", "start": 99, "end": 104, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 12 } } }, { "type": { "label": "name", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "value": "DEFAULT_V", "start": 105, "end": 114, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 22 } } }, { "type": { "label": "=", "beforeExpr": true, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": true, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "=", "start": 115, "end": 116, "loc": { "start": { "line": 4, "column": 23 }, "end": { "line": 4, "column": 24 } } }, { "type": { "label": "`", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 117, "end": 118, "loc": { "start": { "line": 4, "column": 25 }, "end": { "line": 4, "column": 26 } } }, { "type": { "label": "template", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "value": "#version 300 es\n\n//in\nin vec2 a_position;\nin vec2 a_texcoord;\nuniform mat3 u_matrix;\nuniform float u_depth;\n\n\n//out\nout vec2 v_texcoord;\n\nvoid main() {\n gl_Position = vec4((u_matrix * vec3(a_position, 1)).xy, u_depth, 1);\n v_texcoord = a_texcoord;\n}\n", "start": 118, "end": 370, "loc": { "start": { "line": 4, "column": 26 }, "end": { "line": 20, "column": 0 } } }, { "type": { "label": "`", "beforeExpr": false, "startsExpr": true, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null }, "start": 370, "end": 371, "loc": { "start": { "line": 20, "column": 0 }, "end": { "line": 20, "column": 1 } } }, { "type": { "label": "eof", "beforeExpr": false, "startsExpr": false, "rightAssociative": false, "isLoop": false, "isAssign": false, "prefix": false, "postfix": false, "binop": null, "updateContext": null }, "start": 371, "end": 371, "loc": { "start": { "line": 20, "column": 1 }, "end": { "line": 20, "column": 1 } } } ] }