bfops / playform

Voxel sandbox project in Rust
http://playformdev.blogspot.ca/
MIT License
212 stars 24 forks source link

use triangle strips and vertex indices #48

Open bfops opened 10 years ago

bfops commented 10 years ago

since 603d3f28504993439f409a92e716641572951f51, cube vertices only contain positions again. Send the 8 vertices to VRAM, and use indices to construct a triangle strip.

https://www.cs.umd.edu/gvil/papers/av_ts.pdf - using 14 indices to construct a cube with a triangle strip. Note the triangles are constructed clockwise - we need to use the indices in reverse order.

https://www.opengl.org/discussion_boards/showthread.php/184752-triangle-strip-which-triangle-am-I-in - passing triangle-specific information (e.g. normal vectors) in a triangle strip.

bfops commented 10 years ago

we can actually get the savings from the geometry shader back by using a uniform array! http://www.reddit.com/r/rust_gamedev/comments/2fmfkz/playform_gets_a_little_more_voxely_and_saves_a/cke2m98

bfops commented 10 years ago

https://www.opengl.org/discussion_boards/showthread.php/184768-unknown-sized-uniform-struct-arrays?p=1261576

bfops commented 10 years ago

will tie in with isosurface extraction https://github.com/bfops/playform/issues/55