Commit: 83c85c9c985e82c2437a64ab540b26d7f8cce3af
Author: Nick Wu
Date:   Fri Aug 10 15:51:08 2018 +0800
Branches: soc-2018-npr
https://developer.blender.org/rB83c85c9c985e82c2437a64ab540b26d7f8cce3af

Fixed shader variable naming style issue.

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

M       source/blender/draw/engines/lanpr/lanpr_engine.c
M       source/blender/draw/engines/lanpr/lanpr_ops.c
M       source/blender/draw/engines/lanpr/lanpr_snake.c
M       source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl
M       source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl
M       
source/blender/draw/engines/lanpr/shaders/lanpr_snake_image_peel_frag.glsl
M       
source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_frag.glsl
M       
source/blender/draw/engines/lanpr/shaders/lanpr_snake_line_connection_geom.glsl
M       source/blender/draw/engines/lanpr/shaders/lanpr_software_chain_geom.glsl

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

diff --git a/source/blender/draw/engines/lanpr/lanpr_engine.c 
b/source/blender/draw/engines/lanpr/lanpr_engine.c
index daa141b539b..7ba0427b65e 100644
--- a/source/blender/draw/engines/lanpr/lanpr_engine.c
+++ b/source/blender/draw/engines/lanpr/lanpr_engine.c
@@ -226,23 +226,23 @@ static void lanpr_cache_init(void *vedata){
 
                psl->edge_intermediate = DRW_pass_create("Edge Detection", 
DRW_STATE_WRITE_COLOR);
                stl->g_data->edge_detect_shgrp = 
DRW_shgroup_create(lanpr_share.edge_detect_shader, psl->edge_intermediate);
-               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"TexSample0", &txl->depth);
-               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"TexSample1", &txl->color);
-               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"TexSample2", &txl->normal);
+               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"tex_sample_0", &txl->depth);
+               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"tex_sample_1", &txl->color);
+               DRW_shgroup_uniform_texture_ref(stl->g_data->edge_detect_shgrp, 
"tex_sample_2", &txl->normal);
 
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"zNear", &stl->g_data->znear, 1);
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"zfFar", &stl->g_data->zfar, 1);
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"z_near", &stl->g_data->znear, 1);
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"z_far", &stl->g_data->zfar, 1);
 
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"uValue0", &stl->g_data->normal_clamp, 1);// normal clamp
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"uValue1", &stl->g_data->normal_strength, 1);// normal strength
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"uValue2", &stl->g_data->depth_clamp, 1);// depth clamp
-               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"uValue3", &stl->g_data->depth_strength, 1);// depth strength
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"normal_clamp", &stl->g_data->normal_clamp, 1);// normal clamp
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"normal_strength", &stl->g_data->normal_strength, 1);// normal strength
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"depth_clamp", &stl->g_data->depth_clamp, 1);// depth clamp
+               DRW_shgroup_uniform_float(stl->g_data->edge_detect_shgrp, 
"depth_strength", &stl->g_data->depth_strength, 1);// depth strength
                DRW_shgroup_call_add(stl->g_data->edge_detect_shgrp, quad, 
NULL);
 
                psl->edge_thinning = DRW_pass_create("Edge Thinning Stage 1", 
DRW_STATE_WRITE_COLOR);
                stl->g_data->edge_thinning_shgrp = 
DRW_shgroup_create(lanpr_share.edge_thinning_shader, psl->edge_thinning);
-               
DRW_shgroup_uniform_texture_ref(stl->g_data->edge_thinning_shgrp, "TexSample0", 
&dtxl->color);
-               DRW_shgroup_uniform_int(stl->g_data->edge_thinning_shgrp, 
"Stage", &stl->g_data->stage, 1);
+               
DRW_shgroup_uniform_texture_ref(stl->g_data->edge_thinning_shgrp, 
"tex_sample_0", &dtxl->color);
+               DRW_shgroup_uniform_int(stl->g_data->edge_thinning_shgrp, 
"stage", &stl->g_data->stage, 1);
                DRW_shgroup_call_add(stl->g_data->edge_thinning_shgrp, quad, 
NULL);
 
        }
@@ -290,8 +290,8 @@ static void lanpr_cache_init(void *vedata){
                DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"line_thickness_material", &ll->thickness_material, 1);
                DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"line_thickness_edge_mark", &ll->thickness_edge_mark, 1);
                DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"line_thickness_intersection", &ll->thickness_intersection, 1);
-               DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"zNear", &stl->g_data->dpix_znear, 1);
-               DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"zFar", &stl->g_data->dpix_zfar, 1);
+               DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"z_near", &stl->g_data->dpix_znear, 1);
+               DRW_shgroup_uniform_float(stl->g_data->dpix_preview_shgrp, 
"z_far", &stl->g_data->dpix_zfar, 1);
 
                pd->begin_index = 0;
                int fsize = sizeof(float) * 4 * TNS_DPIX_TEXTURE_SIZE * 
TNS_DPIX_TEXTURE_SIZE;
diff --git a/source/blender/draw/engines/lanpr/lanpr_ops.c 
b/source/blender/draw/engines/lanpr/lanpr_ops.c
index 5d37e903ecb..feda61395d4 100644
--- a/source/blender/draw/engines/lanpr/lanpr_ops.c
+++ b/source/blender/draw/engines/lanpr/lanpr_ops.c
@@ -3084,10 +3084,10 @@ void lanpr_software_draw_scene(void *vedata, 
GPUFrameBuffer *dfb, int is_render)
                                float *tld = &lanpr->taper_left_distance, *tls 
= &lanpr->taper_left_strength,
                                      *trd = &lanpr->taper_right_distance, *trs 
= &lanpr->taper_right_strength;
 
-                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"TaperLDist", tld, 1);
-                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"TaperLStrength", tls, 1);
-                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"TaperRDist", lanpr->use_same_taper ? tld : trd, 1);
-                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"TaperRStrength", lanpr->use_same_taper ? tls : trs, 1);
+                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"taper_l_dist", tld, 1);
+                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"taper_r_dist", tls, 1);
+                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"taper_l_strength", lanpr->use_same_taper ? tld : trd, 1);
+                               DRW_shgroup_uniform_float(rb->ChainShgrp, 
"taper_r_strength", lanpr->use_same_taper ? tls : trs, 1);
 
                                //need to add component enable/disable option.
                                DRW_shgroup_call_add(rb->ChainShgrp, 
lanpr->render_buffer->ChainDrawBatch, NULL);
diff --git a/source/blender/draw/engines/lanpr/lanpr_snake.c 
b/source/blender/draw/engines/lanpr/lanpr_snake.c
index fcb3b0552b8..319f089f8e9 100644
--- a/source/blender/draw/engines/lanpr/lanpr_snake.c
+++ b/source/blender/draw/engines/lanpr/lanpr_snake.c
@@ -463,12 +463,12 @@ void lanpr_snake_draw_scene(LANPR_TextureList *txl, 
LANPR_FramebufferList *fbl,
 
        psl->snake_pass = DRW_pass_create("Snake Visualization Pass", 
DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_ALWAYS);
        pd->snake_shgrp = 
DRW_shgroup_create(lanpr_share.snake_connection_shader, psl->snake_pass);
-       DRW_shgroup_uniform_float(pd->snake_shgrp, "LineWidth", 
&lanpr->line_thickness, 1);
-       DRW_shgroup_uniform_float(pd->snake_shgrp, "TaperLDist", tld, 1);
-       DRW_shgroup_uniform_float(pd->snake_shgrp, "TaperLStrength", tls, 1);
-       DRW_shgroup_uniform_float(pd->snake_shgrp, "TaperRDist", 
lanpr->use_same_taper ? tld : trd, 1);
-       DRW_shgroup_uniform_float(pd->snake_shgrp, "TaperRStrength", 
lanpr->use_same_taper ? tls : trs, 1);
-       DRW_shgroup_uniform_vec4(pd->snake_shgrp, "LineColor", 
lanpr->line_color, 1);
+       DRW_shgroup_uniform_float(pd->snake_shgrp, "line_width", 
&lanpr->line_thickness, 1);
+       DRW_shgroup_uniform_float(pd->snake_shgrp, "taper_l_dist", tld, 1);
+       DRW_shgroup_uniform_float(pd->snake_shgrp, "taper_r_dist", tls, 1);
+       DRW_shgroup_uniform_float(pd->snake_shgrp, "taper_l_strength", 
lanpr->use_same_taper ? tld : trd, 1);
+       DRW_shgroup_uniform_float(pd->snake_shgrp, "taper_r_strength", 
lanpr->use_same_taper ? tls : trs, 1);
+       DRW_shgroup_uniform_vec4(pd->snake_shgrp, "line_color", 
lanpr->line_color, 1);
 
        DRW_shgroup_call_add(pd->snake_shgrp, snake_batch, NULL);
        GPU_framebuffer_bind(fbl->edge_intermediate);
diff --git 
a/source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl 
b/source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl
index 8b3f2b3f244..9405cad5fa0 100644
--- a/source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl
+++ b/source/blender/draw/engines/lanpr/shaders/lanpr_dpix_preview_geom.glsl
@@ -15,8 +15,8 @@ uniform float depth_width_influence;
 uniform float depth_width_curve;
 uniform float depth_alpha_influence;
 uniform float depth_alpha_curve;
-uniform float zNear;
-uniform float zFar;
+uniform float z_near;
+uniform float z_far;
 
 uniform vec4 color;
 uniform vec4 background_color;
@@ -38,8 +38,8 @@ out vec4 out_color;
 vec4 use_color = color;
 
 float get_linear_depth(float z){
-       float ze = 2.0 * zNear * zFar / (zFar + zNear - z * (zFar - zNear));
-       return (ze - zNear) / (zFar - zNear);
+       float ze = 2.0 * z_near * z_far / (z_far + z_near - z * (z_far - 
z_near));
+       return (ze - z_near) / (z_far - z_near);
 }
 
 float curve_01(float z, float factor){
diff --git 
a/source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl 
b/source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl
index 38e55b3f870..a1c3ba8437b 100644
--- a/source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl
+++ b/source/blender/draw/engines/lanpr/shaders/lanpr_snake_edge_frag.glsl
@@ -1,13 +1,13 @@
 in vec4 uvcoordsvar;
-uniform sampler2DMS TexSample0;//depth
-uniform sampler2DMS TexSample1;//color
-uniform sampler2DMS TexSample2;//normal
-uniform float uValue0;//normal clamp
-uniform float uValue1;//normal strength
-uniform float uValue2;//depth clamp
-uniform float uValue3;//depth strength
-uniform float zNear;//znear
-uniform float zFar;//zfar
+uniform sampler2DMS tex_sampe_0;//depth
+uniform sampler2DMS tex_sample_1;//color
+uniform sampler2DMS tex_sample_2;//normal
+uniform float normal_clamp;//normal clamp
+uniform float normal_strength;//normal strength
+uniform float depth_clamp;//depth clamp
+uniform float depth_strength;//depth strength
+uniform float z_near;//z_near
+uniform float z_far;//z_far
 
 mat3 sx = mat3(
        1.0, 2.0, 1.0,
@@ -30,7 +30,7 @@ vec3 rgb2hsv(vec3 c)
 }
 float linearDepth(float depthSample){
        float d = 2.0 * depthSample - 1.0;
-       float zLinear = 2.0 * zNear * zFar / (zFar + zNear - d * (zFar - 
zNear));
+       float zLinear = 2.0 * z_near * z_far / (z_far + z_near - d * (z_far - 
z_near));
        return zLinear;
 }
 
@@ -56,7 +56,7 @@ vec4 DetectEdge(sampler2DMS tex, float clamp, float strength){
                                K[i][j] += length(sample3) / 8;
                        }
                }
-               cs += texelFetch(TexSample1, sp, s) / 8;
+               cs += texelFetch(tex_sample_1, sp, s) / 8;
        }
 
        float gx1 = dot(sx[0], I[0]) + dot(sx[1], I[1]) + dot(sx[2], I[2]);
@@ -83,12 +83,12 @@ vec4 DetectEdge(sampler2DMS tex, float clamp, float 
strength){
 
 void main()
 {
-       float nc = uValue0;//(uValue0==0? 0.01:uValue0);
-       float ns = uValue1;//(uValue1==0? 5:   uValue1);
-       float dc = uValue2;//(uValue2==0? 0.2: uValue2);


@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to