May 14, 2015, 17:17 (GMT) |
cleanup: GPUBufferCopyFunc defined twice |
May 14, 2015, 06:57 (GMT) |
clean up GPUx vertex buffer API (part 1) Removed unprimed version of GPUx_vertex_buffer_use function. The new pattern is create, fill, prime, use {draw} done_using, use {draw} done_using ... Renamed GPUx_vertex_buffer_use_primed to GPUx_vertex_buffer_use since there's only one version now. Also removed the _primed suffix from GPUx_element_list_use. TODO: make a wiki page about how to use this API |
May 14, 2015, 04:38 (GMT) |
fix mismatched memory free This string is copied with strdup during GPUx_specify_attrib, needs a plain free. |
May 14, 2015, 03:57 (GMT) |
new function: bind all attrib locations Was binding these by hand in wireframe shader tests, but retyping the name strings is a potential source of errors. Call this function instead after creating VertexBuffer but before linking the GLSL program. |
May 12, 2015, 21:16 (GMT) |
Revert "Add missing stubs for buffer generation." This reverts commit 4040f0af0017409fad4912605527900ba6919173. |
May 11, 2015, 09:09 (GMT) |
Merge branch 'master' into GPU_data_request |
May 11, 2015, 09:08 (GMT) |
Add missing stubs for buffer generation. |
May 11, 2015, 09:04 (GMT) |
Compilation fixes for C90 - still getting link errors related to buffer generation routines. |
April 28, 2015, 23:45 (GMT) |
WIP: fancy wireframe display Exploring some possibilities with wireframe rendering beyond solid color. New effect: color edges based on angle between the faces joined. Loose edges, perimeter edges, and edges joining 3+ faces are colored differently. Some of this code will move to Workflow Shaders. Other parts will move to DerivedMesh data requests �?? AdjacentFaces (struct) and/or angle made by adjacent faces (float). The (incomplete) shader version uses VertexBuffer�??s generic attribute API, which we want to switch everything to eventually. There is a GLSL vertex shader *not* included in this commit because I don�??t know where to put it�?� The CPU version is temporary �?? it�??s equivalent to the shader setup + matching GLSL shader. This particular effect is view independent, so can be done CPU-side once and drawn many times. Other effects I�??m working on are view dependent, so really need the setup + shader split. |
April 27, 2015, 18:55 (GMT) |
check extensions before use in GPUx Using VAOs and integer vertex attributes. VBO support is *not* checked because it�??s guaranteed to be there in a GL 2.1 context. VAOs are not part of GL 2.1, but enjoy nearly universal support. gpu_shader4 is widely supported on recent hardware, not always on older HW. |
April 27, 2015, 18:40 (GMT) |
add runtime check for gpu_shader4 support This extension includes a number of GLSL enhancements: - full integer support - interpolation qualifiers (flat, smooth, noperspective) - gl_VertexID, gl_PrimitiveID - custom fragment shader outputs, for MRT |
April 23, 2015, 09:36 (GMT) |
single alloc per VertexBuffer, down from 2 Using flexible array member from C99. Tested on LLVM/clang, also supported in GCC and MSVC according to docs: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html https://msdn.microsoft.com/en-us/library/b6fae073.aspx |
April 23, 2015, 09:00 (GMT) |
minor cleanup Mostly moving stuff to where it belongs. UNUSED_VARS macro explains intent better than (void)var, so use it. Considered replacing calloc with malloc for ElementList.indices, but it�??s safer to zero this in case not all primitives are set. So calloc it stays! |
April 23, 2015, 07:06 (GMT) |
keep vertex data in main mem or VRAM (not both) If we�??re using VBOs, free our own copy once GL has the data. Data always lives in main memory while being constructed, so that we don�??t need to call any OpenGL functions until it�??s time to draw. |
April 23, 2015, 05:29 (GMT) |
minor cleanup |
April 23, 2015, 04:38 (GMT) |
reset shading to SMOOTH or FLAT missed this as part of GPUx interpolation commit |
April 22, 2015, 07:30 (GMT) |
cleanup my own recent stuff |
April 22, 2015, 06:59 (GMT) |
reduce VRAM usage for flat normals Reduce number of GL verts from (3 * tess_tri_ct) to (1 * loop_ct). Attribute data formats unchanged. stock Suzanne mesh 507 verts, 1005 edges, 500 polys, 500 faces, 1968 loops mode = NORMAL_DRAW_FLAT (3 * tri_ct) verts, vec3s normals (+padding) GPUx batch size: 63886 bytes (3 * tri_ct) verts, vec3s normals (no padding) GPUx batch size: 58080 bytes loop_ct verts, vec3s normals (+padding) GPUx batch size: 45166 bytes loop_ct verts, vec3s normals (no padding) GPUx batch size: 41232 bytes |
April 22, 2015, 06:13 (GMT) |
reduce VRAM usage for loop normals Use GL_SHORT instead of GL_FLOAT for normal attribute. Savings scale proportional to loop count. stock Suzanne mesh 507 verts, 1005 edges, 500 polys, 500 faces, 1968 loops mode = NORMAL_DRAW_LOOP vec3f normals GPUx batch size: 53040 bytes vec3s normals (+padding) GPUx batch size: 45166 bytes vec3s normals (no padding) GPUx batch size: 41232 bytes |
April 22, 2015, 05:23 (GMT) |
determine normal draw mode better based on auto smooth, how many faces are flat vs. smooth, and viewport overrides. |
|