Blender Git Loki

Git Commits -> Revision 062e52b

Revision 062e52b by Lukas Toenne (strand_gpu, strand_nodes)
July 11, 2016, 19:08 (GMT)
Alternative implementation for strand fiber interpolation without a geometry shader.

Geometry shaders easily become performance bottlenecks, for in-depth explanation see e.g.

http://gamedev.stackexchange.com/a/48434
http://rastergrid.com/blog/2010/09/history-of-hardware-tessellation/

The geometry shader was used so far for generating the fiber geometry (line strips)
from just the root vertices. Without a geometry shader every vertex has to be put into
a buffer and uploaded to the GPU (we could use a tesselation shader to cut down on size,
but that remains to be decided later if OpenGL 4.x is available).

To limit the size of this vertex buffer, the vertices contain only minimal necessary
information: an index for the fiber curve, and an interpolation curve parammeter in [0.0, 1.0].
The locations of vertices are interpolated in the vertex shader using texture lookups.
A range of textures encode all the necessary per-fiber attributes, in particular the
interpolation indices and weights wrt. control curves. These control curves are stored in
yet another texture (as is the case with the geometry shader too).

Initial performance seems to improve drastically without the geometry shader.

Commit Details:

Full Hash: 062e52b8ee508babdde804b39aaaced236299760
Parent Commit: fd603e4
Lines Changed: +686, -110

11 Modified Paths:

/release/scripts/startup/bl_ui/properties_data_modifier.py (+1, -0) (Diff)
/source/blender/editors/space_view3d/drawstrands.c (+45, -8) (Diff)
/source/blender/gpu/GPU_buffers.h (+17, -0) (Diff)
/source/blender/gpu/GPU_strands.h (+4, -3) (Diff)
/source/blender/gpu/intern/gpu_buffers.c (+465, -45) (Diff)
/source/blender/gpu/intern/gpu_strands.c (+78, -52) (Diff)
/source/blender/gpu/shaders/gpu_shader_strand_frag.glsl (+1, -0) (Diff)
/source/blender/gpu/shaders/gpu_shader_strand_geom.glsl (+2, -2) (Diff)
/source/blender/gpu/shaders/gpu_shader_strand_vert.glsl (+66, -0) (Diff)
/source/blender/makesdna/DNA_modifier_types.h (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_modifier.c (+6, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021