[Bf-blender-cvs] [e151c8e6f47] temp-lanpr-staging: LANPR: Fix DPIX line thickness bug & format.
YimingWu
noreply at git.blender.org
Thu Sep 5 10:00:18 CEST 2019
Commit: e151c8e6f4783310d7bd20127386d20b4b05ae6b
Author: YimingWu
Date: Thu Sep 5 15:59:43 2019 +0800
Branches: temp-lanpr-staging
https://developer.blender.org/rBe151c8e6f4783310d7bd20127386d20b4b05ae6b
LANPR: Fix DPIX line thickness bug & format.
===================================================================
M intern/cycles/kernel/shaders/node_noise_texture.osl
M source/blender/draw/engines/lanpr/lanpr_cpu.c
M source/blender/draw/engines/lanpr/lanpr_engine.c
M source/blender/editors/include/ED_lanpr.h
M source/blender/editors/lanpr/lanpr_cpu.c
M source/blender/editors/lanpr/lanpr_intern.h
===================================================================
diff --git a/intern/cycles/kernel/shaders/node_noise_texture.osl b/intern/cycles/kernel/shaders/node_noise_texture.osl
index 242a7e33f60..e3da2d16371 100644
--- a/intern/cycles/kernel/shaders/node_noise_texture.osl
+++ b/intern/cycles/kernel/shaders/node_noise_texture.osl
@@ -131,7 +131,7 @@ shader node_noise_texture(int use_mapping = 0,
vector3 p = Vector;
if (use_mapping)
p = transform(mapping, p);
-
+
p *= Scale;
float w = W * Scale;
diff --git a/source/blender/draw/engines/lanpr/lanpr_cpu.c b/source/blender/draw/engines/lanpr/lanpr_cpu.c
index 7db25fb80f7..2e5771a8ca5 100644
--- a/source/blender/draw/engines/lanpr/lanpr_cpu.c
+++ b/source/blender/draw/engines/lanpr/lanpr_cpu.c
@@ -137,7 +137,8 @@ static void lanpr_rebuild_render_draw_command(LANPR_RenderBuffer *rb, LANPR_Line
tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->edge_marks, tv, tn, &tn, ll, 4.0f);
}
if (ll->intersection.use) {
- tv = ED_lanpr_make_leveled_edge_vertex_array(rb, &rb->intersection_lines, tv, tn, &tn, ll, 5.0f);
+ tv = ED_lanpr_make_leveled_edge_vertex_array(
+ rb, &rb->intersection_lines, tv, tn, &tn, ll, 5.0f);
}
for (i = 0; i < vertCount; i++) {
@@ -371,11 +372,11 @@ void lanpr_software_draw_scene(void *vedata, GPUFrameBuffer *dfb, int is_render)
DRW_shgroup_uniform_vec3(rb->ChainShgrp, "normal_direction", normal_object_direction, 1);
DRW_shgroup_uniform_int(rb->ChainShgrp, "occlusion_level_start", &ll->level_start, 1);
- DRW_shgroup_uniform_int(rb->ChainShgrp,
- "occlusion_level_end",
- (ll->flags & LANPR_LINE_LAYER_USE_MULTIPLE_LEVELS) ? &ll->level_end :
- &ll->level_start,
- 1);
+ DRW_shgroup_uniform_int(
+ rb->ChainShgrp,
+ "occlusion_level_end",
+ (ll->flags & LANPR_LINE_LAYER_USE_MULTIPLE_LEVELS) ? &ll->level_end : &ll->level_start,
+ 1);
DRW_shgroup_uniform_vec4(
rb->ChainShgrp, "preview_viewport", stl->g_data->dpix_viewport, 1);
diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c b/source/blender/draw/engines/lanpr/lanpr_engine.c
index 295e1f12411..8708ffda9a8 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -424,9 +424,14 @@ static void lanpr_cache_init(void *vedata)
ED_lanpr_calculate_normal_object_vector(ll, normal_object_direction);
static int normal_effect_inverse;
+ static int zero_value = 0;
normal_effect_inverse = (ll->flags & LANPR_LINE_LAYER_NORMAL_INVERSE);
- DRW_shgroup_uniform_int(stl->g_data->dpix_preview_shgrp, "normal_mode", &ll->normal_mode, 1);
+ DRW_shgroup_uniform_int(stl->g_data->dpix_preview_shgrp,
+ "normal_mode",
+ (ll->flags & LANPR_LINE_LAYER_NORMAL_ENABLED) ? &ll->normal_mode :
+ &zero_value,
+ 1);
DRW_shgroup_uniform_int(
stl->g_data->dpix_preview_shgrp, "normal_effect_inverse", &normal_effect_inverse, 1);
DRW_shgroup_uniform_float(
diff --git a/source/blender/editors/include/ED_lanpr.h b/source/blender/editors/include/ED_lanpr.h
index 857b22fe07d..126e412bdeb 100644
--- a/source/blender/editors/include/ED_lanpr.h
+++ b/source/blender/editors/include/ED_lanpr.h
@@ -558,12 +558,12 @@ void ED_lanpr_chain_clear_picked_flag(struct LANPR_RenderBuffer *rb);
int ED_lanpr_count_leveled_edge_segment_count(ListBase *LineList, struct LANPR_LineLayer *ll);
void *ED_lanpr_make_leveled_edge_vertex_array(struct LANPR_RenderBuffer *rb,
- ListBase *LineList,
- float *vertexArray,
- float *NormalArray,
- float **NextNormal,
- LANPR_LineLayer *ll,
- float componet_id);
+ ListBase *LineList,
+ float *vertexArray,
+ float *NormalArray,
+ float **NextNormal,
+ LANPR_LineLayer *ll,
+ float componet_id);
void ED_lanpr_calculation_set_flag(LANPR_RenderStatus flag);
bool ED_lanpr_calculation_flag_check(LANPR_RenderStatus flag);
diff --git a/source/blender/editors/lanpr/lanpr_cpu.c b/source/blender/editors/lanpr/lanpr_cpu.c
index 1563bbf29d2..1e8dffc7e12 100644
--- a/source/blender/editors/lanpr/lanpr_cpu.c
+++ b/source/blender/editors/lanpr/lanpr_cpu.c
@@ -2829,12 +2829,12 @@ int lanpr_count_intersection_segment_count(LANPR_RenderBuffer *rb)
return Count;
}
void *ED_lanpr_make_leveled_edge_vertex_array(LANPR_RenderBuffer *UNUSED(rb),
- ListBase *LineList,
- float *vertexArray,
- float *NormalArray,
- float **NextNormal,
- LANPR_LineLayer *ll,
- float componet_id)
+ ListBase *LineList,
+ float *vertexArray,
+ float *NormalArray,
+ float **NextNormal,
+ LANPR_LineLayer *ll,
+ float componet_id)
{
LinkData *lip;
LANPR_RenderLine *rl;
diff --git a/source/blender/editors/lanpr/lanpr_intern.h b/source/blender/editors/lanpr/lanpr_intern.h
index 1b34b9d889d..c8a3feda915 100644
--- a/source/blender/editors/lanpr/lanpr_intern.h
+++ b/source/blender/editors/lanpr/lanpr_intern.h
@@ -39,9 +39,15 @@ struct LANPR_RenderLine;
struct LANPR_RenderBuffer;
void *list_append_pointer_static(ListBase *h, struct LANPR_StaticMemPool *smp, void *p);
-void *list_append_pointer_static_sized(ListBase *h, struct LANPR_StaticMemPool *smp, void *p, int size);
+void *list_append_pointer_static_sized(ListBase *h,
+ struct LANPR_StaticMemPool *smp,
+ void *p,
+ int size);
void *list_push_pointer_static(ListBase *h, struct LANPR_StaticMemPool *smp, void *p);
-void *list_push_pointer_static_sized(ListBase *h, struct LANPR_StaticMemPool *smp, void *p, int size);
+void *list_push_pointer_static_sized(ListBase *h,
+ struct LANPR_StaticMemPool *smp,
+ void *p,
+ int size);
void *list_append_pointer_static_pool(struct LANPR_StaticMemPool *mph, ListBase *h, void *p);
void *list_pop_pointer_no_free(ListBase *h);
@@ -52,13 +58,17 @@ void *mem_static_aquire(struct LANPR_StaticMemPool *smp, int size);
void *mem_static_aquire_thread(struct LANPR_StaticMemPool *smp, int size);
void *mem_static_destroy(LANPR_StaticMemPool *smp);
-void tmat_make_ortho_matrix_44d(
- double (*mProjection)[4], double xMin, double xMax, double yMin, double yMax, double zMin, double zMax);
+void tmat_make_ortho_matrix_44d(double (*mProjection)[4],
+ double xMin,
+ double xMax,
+ double yMin,
+ double yMax,
+ double zMin,
+ double zMax);
void tmat_make_perspective_matrix_44d(
double (*mProjection)[4], double fFov_rad, double fAspect, double zMin, double zMax);
int lanpr_count_this_line(struct LANPR_RenderLine *rl, struct LANPR_LineLayer *ll);
int lanpr_count_intersection_segment_count(struct LANPR_RenderBuffer *rb);
-
#endif
More information about the Bf-blender-cvs
mailing list