├── .gitignore
├── lib
├── wireShader.js
├── createMesh.js
└── examples.js
├── README.md
├── LICENSE
├── index.html
├── package.json
├── main.css
└── main.js
/.gitignore:
--------------------------------------------------------------------------------
1 | lib-cov
2 | *.seed
3 | *.log
4 | *.csv
5 | *.dat
6 | *.out
7 | *.pid
8 | *.gz
9 |
10 | pids
11 | logs
12 | results
13 |
14 | npm-debug.log
15 | node_modules/*
--------------------------------------------------------------------------------
/lib/wireShader.js:
--------------------------------------------------------------------------------
1 | "use strict"
2 | var createShader = require("gl-shader")
3 |
4 | module.exports = function(gl) {
5 | return createShader(gl,
6 | "attribute vec3 position;\
7 | uniform mat4 projection;\
8 | uniform mat4 view;\
9 | uniform mat4 model;\
10 | void main() {\
11 | gl_Position=projection * view * model * vec4(position, 1.0);\
12 | }",
13 | "void main() {\
14 | gl_FragColor = vec4(0, 1, 0, 1);\
15 | }")
16 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | voxel-mipmap-demo
2 | =================
3 | Demonstration of texture mapping with greedy meshing.
4 |
5 | * Left click rotates
6 | * Right click/shift pans
7 | * Middle click/scroll/alt zooms
8 |
9 | [Check it out in your browser](http://mikolalysenko.github.io/voxel-mipmap-demo/)
10 |
11 | For more information see the following blog post:
12 |
13 | * [Texture atlases, wrapping and mip mapping](http://0fps.wordpress.com/2013/07/09/texture-atlases-wrapping-and-mip-mapping/)
14 |
15 | ## How to run locally
16 | First you will need to install npm, which comes with node.js. You can get that by going to here:
17 |
18 | * [https://nodejs.org/](https://nodejs.org/)
19 |
20 | Then, go into the root directory of the project and type:
21 |
22 | npm install
23 |
24 | Once that is done, you can run the project in your browser by typing:
25 |
26 | npm start
27 |
28 | That will start a local server. To view the demo in your browser, connect to localhost on the port that shows up. For example, http://localhost:9966
29 |
30 | ## Credits
31 | (c) 2013 Mikola Lysenko. MIT License
32 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 |
2 | The MIT License (MIT)
3 |
4 | Copyright (c) 2013 Mikola Lysenko
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy
7 | of this software and associated documentation files (the "Software"), to deal
8 | in the Software without restriction, including without limitation the rights
9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 | copies of the Software, and to permit persons to whom the Software is
11 | furnished to do so, subject to the following conditions:
12 |
13 | The above copyright notice and this permission notice shall be included in
14 | all copies or substantial portions of the Software.
15 |
16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 | THE SOFTWARE.
23 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |