From 0c728a8a359a3644d35fe2307c84d29845d4f701 Mon Sep 17 00:00:00 2001 From: ExMix Date: Fri, 31 Jan 2014 09:50:14 +0300 Subject: [PATCH] [drape] shaders documentation --- drape/shaders/doc/line_vertex_shader_vsh.txt | 15 +++++++++++++++ ...sh.txt => solid_color_fragment_shader_fsh.txt} | 0 2 files changed, 15 insertions(+) create mode 100644 drape/shaders/doc/line_vertex_shader_vsh.txt rename drape/shaders/doc/{solid_area_fragment_shader_fsh.txt => solid_color_fragment_shader_fsh.txt} (100%) diff --git a/drape/shaders/doc/line_vertex_shader_vsh.txt b/drape/shaders/doc/line_vertex_shader_vsh.txt new file mode 100644 index 0000000000..a26ebcc508 --- /dev/null +++ b/drape/shaders/doc/line_vertex_shader_vsh.txt @@ -0,0 +1,15 @@ +Transformation shader for lines. + +Attributes: +- position (vec4) x, y, z, 1 +- direction (vec4) Tx, Ty, lineHalfWidth + +To use this vertex shader you must format vertex data by this rule: + when we draw line we must create 2 triangle on one line segment but 2 vertex that produced by one line point + (vertex + halfWidthNormalVector). must be equal. Width will be computed in this shader. + For example we have one segment line { A = (0, 0), B = (10, 10) } + thiangles must be [ A, A, B, B]. + Direction is the vector for normal calculate, and direction for upper "A" must be opposite for direction for bottom "A" + [B - A, A - B, B - A, A - B] + In this case we can mul direction on modelView separate from position and get line rotation in pixel coordinate, + format normal and create a width of line diff --git a/drape/shaders/doc/solid_area_fragment_shader_fsh.txt b/drape/shaders/doc/solid_color_fragment_shader_fsh.txt similarity index 100% rename from drape/shaders/doc/solid_area_fragment_shader_fsh.txt rename to drape/shaders/doc/solid_color_fragment_shader_fsh.txt