Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-01-22 18:14:12 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-01-30 00:00:15 +0300
commit01a62515cb2be0c7c0b13c2fcd8332509ad6a3df (patch)
treee74169d87de7e096ef121ee5bbeb375225574ec8
parent0f35436bcfaa6f415d5a43bd62bae86320bd75ae (diff)
DRW: Add "hardcoded" stipples for sun ray display.
-rw-r--r--source/blender/draw/intern/draw_cache.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/draw/intern/draw_cache.c b/source/blender/draw/intern/draw_cache.c
index c759a29ee0c..3b4180c0375 100644
--- a/source/blender/draw/intern/draw_cache.c
+++ b/source/blender/draw/intern/draw_cache.c
@@ -1068,7 +1068,7 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void)
if (!SHC.drw_lamp_sunrays) {
float v[2], v1[2], v2[2];
- /* Position Only 3D format */
+ /* Position Only 2D format */
static Gwn_VertFormat format = { 0 };
static struct { uint pos; } attr_id;
if (format.attrib_ct == 0) {
@@ -1076,17 +1076,21 @@ Gwn_Batch *DRW_cache_lamp_sunrays_get(void)
}
Gwn_VertBuf *vbo = GWN_vertbuf_create_with_format(&format);
- GWN_vertbuf_data_alloc(vbo, 16);
+ GWN_vertbuf_data_alloc(vbo, 32);
for (int a = 0; a < 8; a++) {
v[0] = sinf((2.0f * M_PI * a) / 8.0f);
v[1] = cosf((2.0f * M_PI * a) / 8.0f);
- mul_v2_v2fl(v1, v, 1.2f);
- mul_v2_v2fl(v2, v, 2.5f);
+ mul_v2_v2fl(v1, v, 1.6f);
+ mul_v2_v2fl(v2, v, 1.9f);
+ GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4, v1);
+ GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 1, v2);
- GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 2, v1);
- GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 2 + 1, v2);
+ mul_v2_v2fl(v1, v, 2.2f);
+ mul_v2_v2fl(v2, v, 2.5f);
+ GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 2, v1);
+ GWN_vertbuf_attr_set(vbo, attr_id.pos, a * 4 + 3, v2);
}
SHC.drw_lamp_sunrays = GWN_batch_create_ex(GWN_PRIM_LINES, vbo, NULL, GWN_BATCH_OWNS_VBO);