Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
itdan3344
stb
提交
081fd694
S
stb
项目概览
itdan3344
/
stb
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
stb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
081fd694
编写于
4月 01, 2015
作者:
S
Sean Barrett
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
comment tweaks
上级
2cbeaa30
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
49 addition
and
13 deletion
+49
-13
docs/stb_voxel_render_interview.md
docs/stb_voxel_render_interview.md
+41
-6
stb_voxel_render.h
stb_voxel_render.h
+8
-7
未找到文件。
docs/stb_voxel_render_interview.md
浏览文件 @
081fd694
...
...
@@ -60,10 +60,12 @@ environments.
And I'm sure there are other possible benefits to using voxels/blocks.
Hopefully this will make it easier for people to explore the space.
Also, t
he library has a pretty wide range of features to allow
T
he library has a pretty wide range of features to allow
people to come up with some distinctive looks. For example,
the art style of Continue?9876543210. I'm terrible at art,
so this isn't really my thing, but I tried to put in flexible
the art style of Continue?9876543210 was one of the inspirations
for trying to make the multitexturing capabilities flexible.
I'm terrible at art, so this isn't really something I can
come up with myself, but I tried to put in flexible
technology that could be used multiple ways.
One thing I did intentionally was try to make it possible to
...
...
@@ -81,6 +83,35 @@ else with it. E.g. in your authoring tool (or procedural
generation) you can make smooth ground and then cut a
sharp-edged hole in it for a building's basement or whatever.
Another thing you can do is work at a very different scale.
In Minecraft, a person is just under 2 blocks tall. In
Ace of Spades, a person is just under 3 blocks tall. Why
not 4 or 6? Well, partly because you just need a lot more
voxels; if a meter is 2 voxels in Mineraft and 4 voxels in
your game, and you draw the same number of voxels due to
hardware limits, then your game has half the view distance
of Minecraft. Since stb_voxel_render is designed to keep
the meshes small and render efficiently, you can push the
view distance out further than Minecraft--or use a similar
view distance and a higher voxel resolution. You could also
stop making infinite worlds and work at entirely different
scales; where Minecraft is 1 voxel per meter, you could
have 20 voxels per meter and make a small arena that's
50 meters wide and 5 meters tall.
Back when the voxel game Voxatron was announced, the weekend
after the trailer came out I wrote my own little GPU-accelerated
version of the engine and thought that was pretty cool. I've
been tempted many times to extract that and release it, but
I don't want to steal Voxatron's thunder so I've avoided
it. You could use this engine to do the same kind of thing,
although it won't be as efficient as an engine dedicated to
that style of thing would be. (For example, if you're building
the whole mesh from scratch every frame--which you should do
because you want to enable that worst case--you can skip
creating voxel faces that face away from the camera, since
they can never be seen.)
**Q:**
What one thing would you really like to see somebody do?
...
...
@@ -99,7 +130,10 @@ and all of that stuff.
So what I'd really like to see is someone build some kind
of voxel-game-construction-set. Start with stb_voxel_render,
maybe expose all the flexibility of stb_voxel_render (so
people
people can do different things). Thrown in lua or something
else for scripting, make some kind of editor that feels
at least as good as Minecraft and Infinifactory, and see
where that gets you.
**Q:**
Why'd you make this library?
...
...
@@ -130,9 +164,10 @@ About the release video... how long did that take to edit?
**A:**
About seven or eight hours. I had the first version done in
maybe six or seven
t
hours, but then I realized I'd left out
maybe six or seven hours, but then I realized I'd left out
one clip, and when I went back to add it I also gussied up
a couple other moments in the video.
a couple other moments in the video. But there was something
basically identical to it that was done in around six.
**Q:**
Ok, that's it. Thanks, me.
...
...
stb_voxel_render.h
浏览文件 @
081fd694
...
...
@@ -4,11 +4,11 @@
// in this case, one with blocks that can have textures and that
// can also be a few shapes other than cubes.
//
// Video introduction:
// http://www.youtube.com/watch?v=2vnTtiLrV1w
//
Video introduction:
//
http://www.youtube.com/watch?v=2vnTtiLrV1w
//
//
Minecraft-viewer sample app
:
// http://github.com/nothings/stb/tree/master/tests/caveview
//
Minecraft-viewer sample app (not very simple though)
:
//
http://github.com/nothings/stb/tree/master/tests/caveview
//
// It works by creating triangle meshes. The library includes
//
...
...
@@ -552,7 +552,7 @@ struct stbvox_uniform_info
#if 0
// Run this once per frame before drawing all the meshes.
// You still need to se
t the 'transform' uniform for every mesh, etc
.
// You still need to se
parately set the 'transform' uniform for every mesh
.
void setup_uniforms(GLuint shader, float camera_pos[4], GLuint tex1, GLuint tex2)
{
int i;
...
...
@@ -938,8 +938,9 @@ struct stbvox_input_description
// vheight values to use if the geometry is STBVOX_GEOM_vheight*.
// See the vheight discussion.
};
// @OPTIMIZE when specializing, build a single struct with all of the
// 3D-indexed so it's AoS instead of SoA for better cache efficiency
// @OPTIMIZE allow specializing; build a single struct with all of the
// 3D-indexed arrays combined so it's AoS instead of SoA for better
// cache efficiency
enum
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录