{"id":19014421,"url":"https://github.com/vaneenige/webgl-structure","last_synced_at":"2025-04-23T00:43:37.872Z","repository":{"id":134183499,"uuid":"81919354","full_name":"vaneenige/webgl-structure","owner":"vaneenige","description":"🚀 A modern, ES6 based, javascript structure for WebGL based projects with THREE.js! ","archived":false,"fork":false,"pushed_at":"2017-02-14T08:46:07.000Z","size":8,"stargazers_count":44,"open_issues_count":1,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-23T00:43:29.640Z","etag":null,"topics":["es6","eslint","javascript","threejs","webgl","webpack"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vaneenige.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-14T07:46:39.000Z","updated_at":"2023-05-06T11:52:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"b401534d-b255-4423-a29e-f8513c9e276e","html_url":"https://github.com/vaneenige/webgl-structure","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fwebgl-structure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fwebgl-structure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fwebgl-structure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vaneenige%2Fwebgl-structure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vaneenige","download_url":"https://codeload.github.com/vaneenige/webgl-structure/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250348884,"owners_count":21415907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es6","eslint","javascript","threejs","webgl","webpack"],"created_at":"2024-11-08T19:29:25.584Z","updated_at":"2025-04-23T00:43:37.856Z","avatar_url":"https://github.com/vaneenige.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Modern WebGL Structure\n\nDuring recent work related and personal projects I've been playing a lot with WebGL. Getting more and more involved with ES6 code I wanted to create a modern structure to easily configure a WebGL workflow and create a prototype without the need of doing the same setup over and over again.\n\nIn January of 2017 I've been working on expanding my WebGL knowledge and created several experiments on [Codepen](http://codepen.io/cvaneenige/) with [THREE.js](https://threejs.org). Creating these experiments taught me a lot and they have been well-received by the community.\n\n## Installation\n\n1. Run `npm install`.\nThis will install all dependencies needed for the application to run.\n\n2. Run `npm run development`. This will watch and compile your Javascript files.\n\n3. Navigate to `localhost:3000`. You should see a moving cube!\n\n## Usage\n\nThis workflow is based on ES6 techniques and useful tools to make development of your THREE.js application as easy as possible!\n\n#### Global variables\nVariables in ES6 can be made easily accessible by using `imports`. Importing one of the objects below gives you the opportunity to change them in one place and use them in another (these will update automatically).\n\n* **Defaults:** Used to store all THREE.js object: scene, renderer, camera and an object for structure elements like geometries and materials. These can be used in the GUI to update them in real-time.\n\n* **Settings:** Used to store overall user settings, camera variables, canvas background color, default device pixel ratio and a check for mobile devices.\n\n* **Tools:** Used to store useful tools like a [GUI](https://github.com/dataarts/dat.gui) for changing variables in real-time, [orbit controls](https://github.com/mattdesl/three-orbit-controls) for user movement in the THREE.js world and a [stats monitor](https://github.com/mrdoob/stats.js/) to keep track of performance in the application. *These can all be turned on and off in the user settings.*\n\n#### THREE.js\nTo create amazing things with THREE.js you should only have to focus on two things: Creating the magical environment and bringing it to life with movement.\n\n* **Create:** After creating the basic requirements to run a THREE.js world the environment is created. This environment can be stored globally and adjusted by the GUI. This can be found in `environment.js`.\n\n* **Render:** After the environment is created, and the optional tools are enabled, the render function is called and should optimally run at least 60 times a second. Besides the necessary things like updating the stats and setting a background color there's a clean function for updating the environment. This can be found in `render.js`;\n\n#### Overall Workflow\nTo enhance the overall workflow these tools are really helpful to stay consistent with your code style and applying new techniques and standards while staying backwards compatible.\n\n* **Webpack:** Used to compile Javascript (with [Babel](https://babeljs.io)) for backwards compatibility. Running the development script watches and bundles Javascript as you develop and offers a localhost to see your application run on. Running the production script bundles the Javascript once and uglifies it to get the smallest size available. More documentation can be found [here](https://webpack.js.org).\n\n* **ESLint:** Used to maintain Javascript code standards throughout the project. This workflow uses the [Airbnb Style Guide](https://github.com/airbnb/javascript) and can be adjusted to your liking in the `.eslintrc` file.  More documentation can be found [here](http://eslint.org).\n\n## Experiments\nWhile creating these Codepen experiments this workflow improved a lot. I'd love to hear your thoughts on how to make it even better and see your creations!\n\n* [Basic Geometry Animation](http://codepen.io/cvaneenige/full/jyEPPm)\n\n* [Light Reflecting Donuts](http://codepen.io/cvaneenige/full/egNYmb/)\n\n* [Light Reflecting Monkeys](http://codepen.io/cvaneenige/full/PWqqRN)\n\n* [Particle Stream](http://codepen.io/cvaneenige/full/rjVvdM)\n\n* [Rainbow Sprinkles](http://codepen.io/cvaneenige/full/dNYqbp/)\n\n* [Combination is key](http://codepen.io/cvaneenige/full/zNqmxv/)\n\n* [Rainbow Balloons](http://codepen.io/cvaneenige/full/dNXjga/)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaneenige%2Fwebgl-structure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvaneenige%2Fwebgl-structure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvaneenige%2Fwebgl-structure/lists"}