소스 검색

Merge branch 'master' of https://github.com/nothings/stb

Sean Barrett 10 년 전
부모
커밋
a1f8eb30c1
3개의 변경된 파일12개의 추가작업 그리고 12개의 파일을 삭제
  1. 9 10
      stb_voxel_render.h
  2. 2 2
      tests/caveview/README.md
  3. 1 0
      tests/caveview/cave_main.c

+ 9 - 10
stb_voxel_render.h

@@ -200,7 +200,7 @@ extern "C" {
 //
 //
 // CONFIGURATION MACROS
 // CONFIGURATION MACROS
 //
 //
-//  #define STBVOX_CONFIG_MODE <integer>
+//  #define STBVOX_CONFIG_MODE <integer>           // REQUIRED
 //     Configures the overall behavior of stb_voxel_render. This
 //     Configures the overall behavior of stb_voxel_render. This
 //     can affect the shaders, the uniform info, and other things.
 //     can affect the shaders, the uniform info, and other things.
 //     (If you need more than one mode in the same app, you can
 //     (If you need more than one mode in the same app, you can
@@ -214,15 +214,14 @@ extern "C" {
 //            21               Untextured blocks, 20-byte quads
 //            21               Untextured blocks, 20-byte quads
 //
 //
 //
 //
-//  #define STBVOX_CONFIG_PRECISION_Z  <integer>
+//  #define STBVOX_CONFIG_PRECISION_Z  <integer>   // OPTIONAL
 //     Defines the number of bits of fractional position for Z.
 //     Defines the number of bits of fractional position for Z.
-//     Only 0 or 1 are valid. If 0, then a single mesh has
-//     twice the legal Z range; e.g. in modes 0,1,20,21,
-//     Z in the mesh can extend to 511 instead of 255.
-//     However, half-height blocks cannot be used.
+//     Only 0 or 1 are valid. 1 is the default. If 0, then a
+//     single mesh has twice the legal Z range; e.g. in
+//     modes 0,1,20,21, Z in the mesh can extend to 511 instead
+//     of 255. However, half-height blocks cannot be used.
 //
 //
-//
-// All of the following just #ifdef tested so need no values.
+// All of the following just #ifdef tested so need no values, and are optional.
 //
 //
 //    STBVOX_CONFIG_BLOCKTYPE_SHORT
 //    STBVOX_CONFIG_BLOCKTYPE_SHORT
 //        use unsigned 16-bit values for 'blocktype' in the input instead of 8-bit values
 //        use unsigned 16-bit values for 'blocktype' in the input instead of 8-bit values
@@ -245,11 +244,11 @@ extern "C" {
 //        Declares a lighting function hook; you must append a lighting function
 //        Declares a lighting function hook; you must append a lighting function
 //        to the shader before compiling it:
 //        to the shader before compiling it:
 //            vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient);
 //            vec3 compute_lighting(vec3 pos, vec3 norm, vec3 albedo, vec3 ambient);
-//        'ambient' is the half-lambert ambient light with vertex ao applied
+//        'ambient' is the half-lambert ambient light with vertex ambient-occlusion applied
 //
 //
 //    STBVOX_CONFIG_FOG_SMOOTHSTEP
 //    STBVOX_CONFIG_FOG_SMOOTHSTEP
 //        Defines a simple unrealistic fog system designed to maximize
 //        Defines a simple unrealistic fog system designed to maximize
-//        unobscured view distance while not looking to weird when things
+//        unobscured view distance while not looking too weird when things
 //        emerge from the fog. Configured using an extra array element
 //        emerge from the fog. Configured using an extra array element
 //        in the STBVOX_UNIFORM_ambient uniform.
 //        in the STBVOX_UNIFORM_ambient uniform.
 //
 //

+ 2 - 2
tests/caveview/README.md

@@ -3,8 +3,8 @@
 ### How to run it?
 ### How to run it?
 
 
 There's no GUI. Find a directory with Minecraft Anvil files (.mca).
 There's no GUI. Find a directory with Minecraft Anvil files (.mca).
-Copy a Minecraft "terrain.png" into that directory. Run from that
-directory.
+Copy a Minecraft "terrain.png" into that directory (do a google
+image search). Run from that directory.
 
 
 ### How accurate is this as a Minecraft viewer?
 ### How accurate is this as a Minecraft viewer?
 
 

+ 1 - 0
tests/caveview/cave_main.c

@@ -535,6 +535,7 @@ int SDL_main(int argc, char **argv)
    SDL_GL_SetAttribute(SDL_GL_RED_SIZE  , 8);
    SDL_GL_SetAttribute(SDL_GL_RED_SIZE  , 8);
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE , 8);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE , 8);
+   SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
 
 
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_COMPATIBILITY);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);