[Bf-blender-cvs] [065b1d0] strand_gpu: Fix for strand curve interpolation length.

Lukas Tönne noreply at git.blender.org
Sun Jul 17 14:03:13 CEST 2016


Commit: 065b1d06e373b0ef597e8a9465e7d39c67f20687
Author: Lukas Tönne
Date:   Sun Jul 17 14:02:26 2016 +0200
Branches: strand_gpu
https://developer.blender.org/rB065b1d06e373b0ef597e8a9465e7d39c67f20687

Fix for strand curve interpolation length.

The shader was overshooting the actual strand length by one segment.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_strand_util.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_strand_util.glsl b/source/blender/gpu/shaders/gpu_shader_strand_util.glsl
index 50e2547..773aee8 100644
--- a/source/blender/gpu/shaders/gpu_shader_strand_util.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_strand_util.glsl
@@ -56,7 +56,7 @@ void interpolate_vertex(int fiber_index, float curve_param,
 		uvec2 curve = texelFetch(samplers.control_curves, int(control_index[k])).xy;
 		int verts_begin = int(curve.x);
 		cnum_verts[k] = int(curve.y);
-		float segment = curve_param * float(cnum_verts[k]);
+		float segment = curve_param * float(cnum_verts[k] - 1);
 
 		vec3 croot = texelFetch(samplers.control_points, verts_begin).xyz;
 		vec3 offset = root - croot;




More information about the Bf-blender-cvs mailing list