Blender Git Loki

Blender Git "strand_nodes" branch commits.

Page: 5 / 37

July 13, 2016, 13:00 (GMT)
Fix for incorrect buffer size calculation.

The fiber vertex buffer was calculated more than 10x bigger than necessary ...
July 13, 2016, 12:01 (GMT)
Implementation of Curl effect for vertex displacement.
July 13, 2016, 03:33 (GMT)
Ensure correct storage of curve normals and tangents with edit BMesh curves.
July 12, 2016, 11:00 (GMT)
Common control curve interpolation utility function.
July 12, 2016, 09:50 (GMT)
Store buffer textures for the rotating frame on control curves.

This frame will allow better deformation effects for bent curves.
July 12, 2016, 06:09 (GMT)
Use DynString to "include" shared code in the strand vert/geom/frag shaders.

This way we can avoid duplicate code for effects without going out of sync.
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.
July 11, 2016, 07:22 (GMT)
Added "effects" to the hair modifier for testing deformation of the hair in the shader.

These features will ultimately be implemented through nodes, but they are quite useful
for testing the shading itself and the performance.
July 10, 2016, 07:47 (GMT)
A couple of additional per-fiber attributes, for deforming strand fibers.

The orientation of the hair root ("root space") as well as a parametric
distance on the scalp to the primary deforming hair are passed to the
vertex shader. These value will allow deformation modifiers to be applied
for things like noise and clumping.
July 9, 2016, 16:25 (GMT)
Fix broken attribute disabling when some of the attributes are implicit.

The vertex attributes for the fiber buffer use the gl_Vertex builtin variable
of GLSL instead of an explicit named attribute input. The corresponding index
then is -1. The following attributes still need to be disabled however.
July 9, 2016, 12:41 (GMT)
Enum property for selecting among the available hair shader models.

Available choices are the "classic" particle shading (bogus, but useful
for comparison), Kajiya, and Marschner. The Marschner model is not yet
implemented.
July 9, 2016, 07:09 (GMT)
Merge branch 'master' into strand_editmode
July 9, 2016, 07:01 (GMT)
Merge branch 'master' into strand_gpu
July 8, 2016, 14:26 (GMT)
Fix unfreed curve cache in edit mode drawing.
July 8, 2016, 14:22 (GMT)
Unified buffer creation for drawing strands in object and edit mode.

Control strands are now drawn without subdivision. Control and fiber
strands get their own vertex buffers for this purpose.

The intermediate StrandData has been removed, because it is just
redundant storage of the draw data buffers. The results in StrandData
are not used for further editing, so there is really no point in
keeping them around.
July 8, 2016, 00:22 (GMT)
update "bound" flag of GPU strand shaders

Not sure how useful it is to track this. Just making it consistent.

"bound" only stays in sync with GL if we are careful to use the
GPU_strand_shader_bind/unbind functions. Rogue calls to GPU_shader_bind
update GL's state without updating strand shader's "bound" flag.
July 7, 2016, 23:20 (GMT)
initialize variables before use

Now builds with MSVC 2015 (was treating warning as error).

Strand root returned from this function is safer: NULL when len <= 0.
July 7, 2016, 18:33 (GMT)
Subdivision for strand fibers.

This is not supported for the edit mode fibers yet. Unifying the buffer creation
here would help a great deal.
July 7, 2016, 09:17 (GMT)
Implementation of the Kajiya-Kay shading model for hair strands.

This is a common simple shading model defined by Kajiya and Kay in
"Rendering fur with three dimensional textures." (1989)

This model in particular defines specular highlights for reflective
thin cylinders (strands), which gives a much more hair-like appearance
in the viewport. More advanced models (Marschner et. al.) improve this
further, in particular the diffuse term.
July 7, 2016, 07:30 (GMT)
Fragment shader emulation of the current particle hair shading method.

This is a terrible shading method, using the curve tangent as a "normal" vector.
With the old particle hair this was a compromise, because line drawing does not
support nicer shading in the fixed-function pipeline. With GLSL shaders this
is just a quick starting point, and useful for comparison with the old shading.
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021