[Bf-blender-cvs] [40247ee] master: [Windows/make.bat] Clean only after all parameters have been processed so the full path is known, and require a convenience target to be set. Also added a helpful er
Commit: 40247ee491fbe7517a4de3920c3616c9329cde6d Author: lazydodo Date: Sat Sep 17 09:19:54 2016 -0600 Branches: master https://developer.blender.org/rB40247ee491fbe7517a4de3920c3616c9329cde6d [Windows/make.bat] Clean only after all parameters have been processed so the full path is known, and require a convenience target to be set. Also added a helpful error message if any of the required data is not available. === M make.bat === diff --git a/make.bat b/make.bat index 99c1e7f..4f911c3 100644 --- a/make.bat +++ b/make.bat @@ -13,30 +13,7 @@ if NOT "%1" == "" ( REM Help Message if "%1" == "help" ( - echo. - echo Convenience targets - echo - release - echo - debug - echo - full - echo - lite - echo - headless - echo - cycles - echo - bpy - echo. - echo Utilities ^(not associated with building^) - echo - clean - echo - update - echo - nobuild ^(only generate project files^) - echo - showhash ^(Show git hashes of source tree^) - echo. - echo Configuration options - echo - packagename [newname] ^(override default cpack package name^) - echo - x86 ^(override host autodetect and build 32 bit code^) - echo - x64 ^(override host autodetect and build 64 bit code^) - echo - 2013 ^(build with visual studio 2013^) - echo - 2015 ^(build with visual studio 2015^) [EXPERIMENTAL] - echo. - goto EOF + goto HELP ) REM Build Types @@ -46,26 +23,32 @@ if NOT "%1" == "" ( REM Build Configurations ) else if "%1" == "full" ( + set TARGET_SET=1 set BUILD_DIR=%BUILD_DIR%_full set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ -C"%BLENDER_DIR%\build_files\cmake\config\blender_full.cmake" ) else if "%1" == "lite" ( + set TARGET_SET=1 set BUILD_DIR=%BUILD_DIR%_lite set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ -C"%BLENDER_DIR%\build_files\cmake\config\blender_lite.cmake" ) else if "%1" == "cycles" ( + set TARGET_SET=1 set BUILD_DIR=%BUILD_DIR%_cycles set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ -C"%BLENDER_DIR%\build_files\cmake\config\cycles_standalone.cmake" ) else if "%1" == "headless" ( + set TARGET_SET=1 set BUILD_DIR=%BUILD_DIR%_headless set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ -C"%BLENDER_DIR%\build_files\cmake\config\blender_headless.cmake" ) else if "%1" == "bpy" ( + set TARGET_SET=1 set BUILD_DIR=%BUILD_DIR%_bpy set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% ^ -C"%BLENDER_DIR%\build_files\cmake\config\bpy_module.cmake" ) else if "%1" == "release" ( + set TARGET_SET=1 if "%CUDA_PATH_V7_5%"=="" ( echo Cuda 7.5 Not found, aborting! goto EOF @@ -110,15 +93,7 @@ if NOT "%1" == "" ( git submodule foreach git pull --rebase origin master goto EOF ) else if "%1" == "clean" ( - msbuild ^ - %BUILD_DIR%\Blender.sln ^ - /target:clean ^ - /property:Configuration=%BUILD_TYPE% ^ - /verbosity:minimal - if %ERRORLEVEL% NEQ 0 ( - echo Cleaned "%BUILD_DIR%" - ) - goto EOF + set MUST_CLEAN=1 ) else ( echo Command "%1" unknown, aborting! goto EOF @@ -181,12 +156,29 @@ if NOT EXIST %BLENDER_DIR%..\lib\nul ( echo This is needed for building, aborting! goto EOF ) +if NOT "%TARGET_SET%"=="1" ( + echo Error: Convenience target not set + echo This is required for building, aborting! + echo . + goto HELP +) set BUILD_CMAKE_ARGS=%BUILD_CMAKE_ARGS% -G "Visual Studio %BUILD_VS_VER% %BUILD_VS_YEAR%%WINDOWS_ARCH%" if NOT EXIST %BUILD_DIR%\nul ( mkdir %BUILD_DIR% ) - +if "%MUST_CLEAN%"=="1" ( + echo Cleaning %BUILD_DIR% + msbuild ^ + %BUILD_DIR%\Blender.sln ^ + /target:clean ^ + /property:Configuration=%BUILD_TYPE% ^ + /verbosity:minimal + if %ERRORLEVEL% NEQ 0 ( + echo Cleaned "%BUILD_DIR%" + ) + goto EOF +)
[Bf-blender-cvs] [34bd89a] blender2.8: OpenGL: draw_view_axis with new immediate mode
Commit: 34bd89a9f69dc57f2883f3bcf306cdb565139471 Author: Mike Erwin Date: Sat Sep 17 15:52:32 2016 +0200 Branches: blender2.8 https://developer.blender.org/rB34bd89a9f69dc57f2883f3bcf306cdb565139471 OpenGL: draw_view_axis with new immediate mode Changed drawing to use smooth lines, and to fade away when axis points toward / away from screen. (transform manipulators do this already) Also fixed a nearby (but unrelated) missing immUnbindProgram. Part of T49043 === M source/blender/editors/space_view3d/view3d_draw.c === diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index cb07dd8..422e0a9 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -764,58 +764,70 @@ static void drawcursor(Scene *scene, ARegion *ar, View3D *v3d) } } -/* Draw a live substitute of the view icon, which is always shown - * colors copied from transform_manipulator.c, we should keep these matching. */ static void draw_view_axis(RegionView3D *rv3d, rcti *rect) { - const float k = U.rvisize * U.pixelsize; /* axis size */ - const float toll = 0.5; /* used to see when view is quasi-orthogonal */ - float startx = k + 1.0f; /* axis center in screen coordinates, x=y */ - float starty = k + 1.0f; - float ydisp = 0.0; /* vertical displacement to allow obj info text */ - int bright = - 20 * (10 - U.rvibright); /* axis alpha offset (rvibright has range 0-10) */ - float vec[3]; - float dx, dy; + const float k = U.rvisize * U.pixelsize; /* axis size */ + const int bright = - 20 * (10 - U.rvibright); /* axis alpha offset (rvibright has range 0-10) */ - int axis_order[3] = {0, 1, 2}; - int axis_i; + const float startx = rect->xmin + k + 1.0f; /* axis center in screen coordinates, x=y */ + const float starty = rect->ymin + k + 1.0f; - startx += rect->xmin; - starty += rect->ymin; + float axis_pos[3][2]; + unsigned char axis_col[3][4]; + int axis_order[3] = {0, 1, 2}; axis_sort_v3(rv3d->viewinv[2], axis_order); - /* thickness of lines is proportional to k */ - glLineWidth(2); + for (int axis_i = 0; axis_i < 3; axis_i++) { + int i = axis_order[axis_i]; + /* get position of each axis tip on screen */ + float vec[3] = { 0.0f }; + vec[i] = 1.0f; + mul_qt_v3(rv3d->viewquat, vec); + axis_pos[i][0] = startx + vec[0] * k; + axis_pos[i][1] = starty + vec[1] * k; + + /* get color of each axis */ + UI_GetThemeColorShade3ubv(TH_AXIS_X + i, bright, axis_col[i]); /* rgb */ + axis_col[i][3] = 255 * hypotf(vec[0], vec[1]); /* alpha */ + } + + /* draw axis lines */ + glLineWidth(2); + glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - for (axis_i = 0; axis_i < 3; axis_i++) { + VertexFormat *format = immVertexFormat(); + unsigned pos = add_attrib(format, "pos", GL_FLOAT, 2, KEEP_FLOAT); + unsigned col = add_attrib(format, "color", GL_UNSIGNED_BYTE, 4, NORMALIZE_INT_TO_FLOAT); + + immBindBuiltinProgram(GPU_SHADER_2D_FLAT_COLOR); + immBegin(GL_LINES, 6); + + for (int axis_i = 0; axis_i < 3; axis_i++) { int i = axis_order[axis_i]; - const char axis_text[2] = {'x' + i, '\0'}; - zero_v3(vec); - vec[i] = 1.0f; - mul_qt_v3(rv3d->viewquat, vec); - dx = vec[0] * k; - dy = vec[1] * k; + immAttrib4ubv(col, axis_col[i]); + immVertex2f(pos, startx, starty); + immVertex2fv(pos, axis_pos[i]); + } - UI_ThemeColorShadeAlpha(TH_AXIS_X + i, 0, bright); - glBegin(GL_LINES); - glVertex2f(startx, starty + ydisp); - glVertex2f(startx + dx, starty + dy + ydisp); - glEnd(); + immEnd(); + immUnbindProgram(); + glDisable(GL_LINE_SMOOTH); - if (fabsf(dx) > toll || fabsf(dy) > toll) { - BLF_draw_default_ascii(startx + dx + 2, starty + dy + ydisp + 2, 0.0f, axis_text, 1); + /* draw axis names */ + for (int axis_i = 0; axis_i < 3; axis_i++) { + int i = axis_order[axis_i]; - /* BLF_draw_default disables blending */ - glEnable(GL_BLEND); - } + const char axis_text[2] = {'x' + i, '\0'}; + glColor4ubv(axis_col[i]); /* text shader still uses gl_Color */ +
[Bf-blender-cvs] [e21853a] blender2.8: OpenGL: streamline font rendering
Commit: e21853abb9fee9936f0a2d257a5b110535f0937e Author: Mike Erwin Date: Sat Sep 17 13:54:30 2016 +0200 Branches: blender2.8 https://developer.blender.org/rBe21853abb9fee9936f0a2d257a5b110535f0937e OpenGL: streamline font rendering Ignore texture matrix in the shader, stop messing with texture matrix in BLF code. Use linear screen-space interpolation instead of perspective. Avoid redundant call to glMatrixMode. === M source/blender/blenfont/intern/blf.c M source/blender/gpu/shaders/gpu_shader_text_frag.glsl M source/blender/gpu/shaders/gpu_shader_text_vert.glsl === diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index ec1f3d1..d7fcb2c 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -507,11 +507,8 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode) /* Save the current matrix mode. */ glGetIntegerv(GL_MATRIX_MODE, mode); - glMatrixMode(GL_TEXTURE); - glPushMatrix(); - glLoadIdentity(); - - glMatrixMode(GL_MODELVIEW); + if (*mode != GL_MODELVIEW) + glMatrixMode(GL_MODELVIEW); glPushMatrix(); if (font->flags & BLF_MATRIX) @@ -534,10 +531,6 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode) static void blf_draw_gl__end(GLint mode) { - glMatrixMode(GL_TEXTURE); - glPopMatrix(); - - glMatrixMode(GL_MODELVIEW); glPopMatrix(); if (mode != GL_MODELVIEW) diff --git a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl index 4869a63..c8c90d8 100644 --- a/source/blender/gpu/shaders/gpu_shader_text_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_text_frag.glsl @@ -1,6 +1,6 @@ flat varying vec4 color; -varying vec2 texcoord; +noperspective varying vec2 texcoord; uniform sampler2D glyph; diff --git a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl index 8449c42..7247940 100644 --- a/source/blender/gpu/shaders/gpu_shader_text_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_text_vert.glsl @@ -5,12 +5,12 @@ // - generic attrib inputs (2D pos, tex coord) flat varying vec4 color; -varying vec2 texcoord; +noperspective varying vec2 texcoord; void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; color = gl_Color; - texcoord = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st; + texcoord = gl_MultiTexCoord0.st; } ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [1b1275f] blender2.8: add GPU_SHADER_TEXT for font rendering
Commit: 1b1275f0db85101345def817fee486beebaa6b9a Author: Mike Erwin Date: Sat Sep 17 13:33:02 2016 +0200 Branches: blender2.8 https://developer.blender.org/rB1b1275f0db85101345def817fee486beebaa6b9a add GPU_SHADER_TEXT for font rendering With USE_GLSL enabled, GPU_basic_shader(TEXTURE|COLOR) always rendered black. New shader uses a solid color + alpha channel of texture (which in our case is a font glyph). See fragment shader for details. I prefer this approah -- multiple shaders that each do one thing well (and are easy to read/write/understand), instead of one shader that can do many things given the right options. === M source/blender/blenfont/intern/blf.c M source/blender/gpu/CMakeLists.txt M source/blender/gpu/GPU_shader.h M source/blender/gpu/intern/gpu_shader.c A source/blender/gpu/shaders/gpu_shader_text_frag.glsl A source/blender/gpu/shaders/gpu_shader_text_vert.glsl === diff --git a/source/blender/blenfont/intern/blf.c b/source/blender/blenfont/intern/blf.c index 132a0ec..ec1f3d1 100644 --- a/source/blender/blenfont/intern/blf.c +++ b/source/blender/blenfont/intern/blf.c @@ -56,7 +56,7 @@ #include "IMB_colormanagement.h" #ifndef BLF_STANDALONE -#include "GPU_basic_shader.h" +#include "GPU_shader.h" #endif #include "blf_internal_types.h" @@ -501,7 +501,7 @@ static void blf_draw_gl__start(FontBLF *font, GLint *mode) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); #ifndef BLF_STANDALONE - GPU_basic_shader_bind(GPU_SHADER_TEXTURE_2D | GPU_SHADER_USE_COLOR); + GPU_shader_bind(GPU_shader_get_builtin_shader(GPU_SHADER_TEXT)); #endif /* Save the current matrix mode. */ @@ -544,8 +544,9 @@ static void blf_draw_gl__end(GLint mode) glMatrixMode(mode); #ifndef BLF_STANDALONE - GPU_basic_shader_bind(GPU_SHADER_USE_COLOR); + GPU_shader_unbind(); #endif + glDisable(GL_BLEND); } diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 6d3052b..a0b236d 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -130,6 +130,9 @@ data_to_c_simple(shaders/gpu_shader_3D_flat_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_smooth_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_smooth_color_frag.glsl SRC) +data_to_c_simple(shaders/gpu_shader_text_vert.glsl SRC) +data_to_c_simple(shaders/gpu_shader_text_frag.glsl SRC) + data_to_c_simple(shaders/gpu_shader_geometry.glsl SRC) data_to_c_simple(shaders/gpu_shader_fire_frag.glsl SRC) data_to_c_simple(shaders/gpu_shader_smoke_frag.glsl SRC) diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 196b0ec..9b3077e 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -90,6 +90,8 @@ typedef enum GPUBuiltinShader { GPU_SHADER_SMOKE = 2, GPU_SHADER_SMOKE_FIRE= 3, + GPU_SHADER_TEXT, + /* for simple 2D drawing */ GPU_SHADER_2D_UNIFORM_COLOR, GPU_SHADER_2D_FLAT_COLOR, diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index dd576a1..fbb9c9e 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -58,6 +58,9 @@ extern char datatoc_gpu_shader_3D_flat_color_vert_glsl[]; extern char datatoc_gpu_shader_3D_smooth_color_vert_glsl[]; extern char datatoc_gpu_shader_3D_smooth_color_frag_glsl[]; +extern char datatoc_gpu_shader_text_vert_glsl[]; +extern char datatoc_gpu_shader_text_frag_glsl[]; + extern char datatoc_gpu_shader_fire_frag_glsl[]; extern char datatoc_gpu_shader_smoke_vert_glsl[]; extern char datatoc_gpu_shader_smoke_frag_glsl[]; @@ -83,6 +86,8 @@ static struct GPUShadersGlobal { GPUShader *smoke_fire; /* cache for shader fx. Those can exist in combinations so store them here */ GPUShader *fx_shaders[MAX_FX_SHADERS * 2]; + /* for drawing text */ + GPUShader *text; /* for simple 2D drawing */ GPUShader *uniform_color_2D; GPUShader *flat_color_2D; @@ -610,6 +615,14 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader) NULL, NULL, NULL, 0, 0, 0); retval = GG.shaders.smoke_fire; break; + case GPU_SHADER_TEXT: + if (!GG.shaders.text) + GG.shaders.text = GPU_shader_create( + datatoc_gpu_shader_text_vert_glsl, + datatoc_gpu_shader_text_frag_glsl, + NULL, NULL, NULL, 0, 0, 0); + retval =
[Bf-blender-cvs] [c3034af] blender2.8: OpenGL: simplify basic_shader_bind
Commit: c3034afa586e3c5009f852e42c6a46000daa2551 Author: Mike Erwin Date: Fri Sep 16 18:05:00 2016 +0200 Branches: blender2.8 https://developer.blender.org/rBc3034afa586e3c5009f852e42c6a46000daa2551 OpenGL: simplify basic_shader_bind No need to enable/disable texturing with GLSL, just use textures in the fragment shader. === M source/blender/gpu/intern/gpu_basic_shader.c === diff --git a/source/blender/gpu/intern/gpu_basic_shader.c b/source/blender/gpu/intern/gpu_basic_shader.c index a2b8923..c1b9d9a 100644 --- a/source/blender/gpu/intern/gpu_basic_shader.c +++ b/source/blender/gpu/intern/gpu_basic_shader.c @@ -422,23 +422,6 @@ void GPU_basic_shader_bind(int options) { if (USE_GLSL) { if (options) { - const int bound_options = GPU_MATERIAL_STATE.bound_options; - - /* texture options need to be set for basic shader too */ - if (options & GPU_SHADER_TEXTURE_2D) { - glEnable(GL_TEXTURE_2D); - } - else if (bound_options & GPU_SHADER_TEXTURE_2D) { - glDisable(GL_TEXTURE_2D); - } - - if (options & GPU_SHADER_TEXTURE_RECT) { - glEnable(GL_TEXTURE_RECTANGLE); - } - else if (bound_options & GPU_SHADER_TEXTURE_RECT) { - glDisable(GL_TEXTURE_RECTANGLE); - } - GPUShader *shader = gpu_basic_shader(options); if (shader) { ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] [09925d5] master: Fix T49383: Color pickers are available if the color is locked
Commit: 09925d52f5867dbe91dc867e404e248c9a92295a Author: Antonioya Date: Sat Sep 17 09:01:09 2016 +0200 Branches: master https://developer.blender.org/rB09925d52f5867dbe91dc867e404e248c9a92295a Fix T49383: Color pickers are available if the color is locked If the color is locked, the row is disabled, but the picker is still available. This error was present in older versions for layer color. === M release/scripts/startup/bl_ui/properties_grease_pencil_common.py === diff --git a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py index feff5d4..04931b7 100644 --- a/release/scripts/startup/bl_ui/properties_grease_pencil_common.py +++ b/release/scripts/startup/bl_ui/properties_grease_pencil_common.py @@ -491,6 +491,7 @@ class GPENCIL_PIE_settings_palette(Menu): # W - Stroke draw settings col = pie.column(align=True) if palcolor is not None: +col.enabled = not palcolor.lock col.label(text="Stroke") col.prop(palcolor, "color", text="") col.prop(palcolor, "alpha", text="", slider=True) @@ -498,6 +499,7 @@ class GPENCIL_PIE_settings_palette(Menu): # E - Fill draw settings col = pie.column(align=True) if palcolor is not None: +col.enabled = not palcolor.lock col.label(text="Fill") col.prop(palcolor, "fill_color", text="") col.prop(palcolor, "fill_alpha", text="", slider=True) @@ -700,6 +702,7 @@ class GPENCIL_UL_palettecolor(UIList): split = layout.split(percentage=0.25) row = split.row(align=True) +row.enabled = not palcolor.lock row.prop(palcolor, "color", text="", emboss=palcolor.is_stroke_visible) row.prop(palcolor, "fill_color", text="", emboss=palcolor.is_fill_visible) split.prop(palcolor, "name", text="", emboss=False) @@ -888,6 +891,7 @@ class GreasePencilDataPanel: col = split.column() subcol = col.column(align=True) subcol.label("Tint") +subcol.enabled = not gpl.lock subcol.prop(gpl, "tint_color", text="") subcol.prop(gpl, "tint_factor", text="Factor", slider=True) @@ -1025,14 +1029,14 @@ class GreasePencilPaletteColorPanel: # Column 1 - Stroke col = split.column(align=True) -col.active = not pcolor.lock +col.enabled = not pcolor.lock col.label(text="Stroke:") col.prop(pcolor, "color", text="") col.prop(pcolor, "alpha", slider=True) # Column 2 - Fill col = split.column(align=True) -col.active = not pcolor.lock +col.enabled = not pcolor.lock col.label(text="Fill:") col.prop(pcolor, "fill_color", text="") col.prop(pcolor, "fill_alpha", text="Opacity", slider=True) ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs