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:
authorLuca Rood <dev@lucarood.com>2017-05-23 17:56:53 +0300
committerLuca Rood <dev@lucarood.com>2017-05-23 19:39:22 +0300
commit9bc88b69d81fc1839733c0ffb7179fba22d9920c (patch)
tree81f49b619b93ba1ea28341865e85b75bcbdbec50 /source/blender/draw/intern/draw_common.c
parent99c6601a1ffe744ef8592de5da5920156a1097a6 (diff)
Implement particle velocity and acceleration visualization
Diffstat (limited to 'source/blender/draw/intern/draw_common.c')
-rw-r--r--source/blender/draw/intern/draw_common.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c
index 6d6df8dc6f4..69474fb1aed 100644
--- a/source/blender/draw/intern/draw_common.c
+++ b/source/blender/draw/intern/draw_common.c
@@ -26,10 +26,12 @@
#include "DRW_render.h"
#include "GPU_shader.h"
+#include "GPU_texture.h"
#include "UI_resources.h"
#include "BKE_global.h"
+#include "BKE_texture.h"
#include "draw_common.h"
@@ -44,6 +46,7 @@
/* Colors & Constant */
GlobalsUboStorage ts;
struct GPUUniformBuffer *globals_ubo = NULL;
+struct GPUTexture *globals_ramp = NULL;
void DRW_globals_update(void)
{
@@ -110,6 +113,26 @@ void DRW_globals_update(void)
}
globals_ubo = DRW_uniformbuffer_create(sizeof(GlobalsUboStorage), &ts);
+
+ ColorBand ramp = {0};
+ float *colors;
+ int col_size;
+
+ ramp.tot = 3;
+ ramp.data[0].a = 1.0f;
+ ramp.data[0].b = 1.0f;
+ ramp.data[0].pos = 0.0f;
+ ramp.data[1].a = 1.0f;
+ ramp.data[1].g = 1.0f;
+ ramp.data[1].pos = 0.5f;
+ ramp.data[2].a = 1.0f;
+ ramp.data[2].r = 1.0f;
+ ramp.data[2].pos = 1.0f;
+
+ colorband_table_RGBA(&ramp, &colors, &col_size);
+ globals_ramp = GPU_texture_create_1D(col_size, colors, NULL);
+
+ MEM_freeN(colors);
}
/* ********************************* SHGROUP ************************************* */