Revision: 57015
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57015
Author:   ton
Date:     2013-05-25 11:52:52 +0000 (Sat, 25 May 2013)
Log Message:
-----------
Bug fix, irc submitted:

3D Viewport render (internal) didn't render bump maps (it was black even).

Modified Paths:
--------------
    trunk/blender/source/blender/editors/include/ED_view3d.h
    trunk/blender/source/blender/editors/render/render_internal.c
    trunk/blender/source/blender/editors/render/render_opengl.c
    trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
    trunk/blender/source/blender/editors/space_view3d/view3d_view.c

Modified: trunk/blender/source/blender/editors/include/ED_view3d.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_view3d.h    2013-05-25 
09:46:28 UTC (rev 57014)
+++ trunk/blender/source/blender/editors/include/ED_view3d.h    2013-05-25 
11:52:52 UTC (rev 57015)
@@ -215,7 +215,7 @@
 bool ED_view3d_clip_range_get(struct View3D *v3d, struct RegionView3D *rv3d,
                               float *r_clipsta, float *r_clipend, const bool 
use_ortho_factor);
 bool ED_view3d_viewplane_get(struct View3D *v3d, struct RegionView3D *rv3d, 
int winxi, int winyi,
-                             struct rctf *r_viewplane, float *r_clipsta, float 
*r_clipend);
+                             struct rctf *r_viewplane, float *r_clipsta, float 
*r_clipend, float *r_pixsize);
 void ED_view3d_calc_camera_border(struct Scene *scene, struct ARegion *ar,
                                   struct View3D *v3d, struct RegionView3D 
*rv3d,
                                   struct rctf *r_viewborder, const bool 
no_shift);

Modified: trunk/blender/source/blender/editors/render/render_internal.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_internal.c       
2013-05-25 09:46:28 UTC (rev 57014)
+++ trunk/blender/source/blender/editors/render/render_internal.c       
2013-05-25 11:52:52 UTC (rev 57015)
@@ -760,12 +760,12 @@
 
 /* returns true if OK  */
 static bool render_view3d_get_rects(ARegion *ar, View3D *v3d, RegionView3D 
*rv3d, rctf *viewplane, RenderEngine *engine,
-                                    float *r_clipsta, float *r_clipend, bool 
*r_ortho)
+                                    float *r_clipsta, float *r_clipend, float 
*r_pixsize, bool *r_ortho)
 {
        
        if (ar->winx < 4 || ar->winy < 4) return false;
        
-       *r_ortho = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, 
viewplane, r_clipsta, r_clipend);
+       *r_ortho = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, 
viewplane, r_clipsta, r_clipend, r_pixsize);
        
        engine->resolution_x = ar->winx;
        engine->resolution_y = ar->winy;
@@ -819,13 +819,13 @@
        RenderData rdata;
        rctf viewplane;
        rcti cliprct;
-       float clipsta, clipend;
+       float clipsta, clipend, pixsize;
        bool orth, restore = 0;
        char name[32];
                
        G.is_break = FALSE;
        
-       if (false == render_view3d_get_rects(rp->ar, rp->v3d, rp->rv3d, 
&viewplane, rp->engine, &clipsta, &clipend, &orth))
+       if (false == render_view3d_get_rects(rp->ar, rp->v3d, rp->rv3d, 
&viewplane, rp->engine, &clipsta, &clipend, &pixsize, &orth))
                return;
        
        rp->stop = stop;
@@ -875,6 +875,8 @@
        else
                RE_SetWindow(re, &viewplane, clipsta, clipend);
 
+       RE_SetPixelSize(re, pixsize);
+       
        /* database free can crash on a empty Render... */
        if (rp->keep_data == 0 && rstats->convertdone)
                RE_Database_Free(re);
@@ -1002,7 +1004,7 @@
                        update |= PR_UPDATE_VIEW;
                }
                
-               render_view3d_get_rects(ar, v3d, rv3d, &viewplane, engine, 
&clipsta, &clipend, &orth);
+               render_view3d_get_rects(ar, v3d, rv3d, &viewplane, engine, 
&clipsta, &clipend, NULL, &orth);
                RE_GetViewPlane(re, &viewplane1, &disprect1);
                
                if (BLI_rctf_compare(&viewplane, &viewplane1, 0.00001f) == 0)

Modified: trunk/blender/source/blender/editors/render/render_opengl.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_opengl.c 2013-05-25 
09:46:28 UTC (rev 57014)
+++ trunk/blender/source/blender/editors/render/render_opengl.c 2013-05-25 
11:52:52 UTC (rev 57015)
@@ -191,7 +191,7 @@
                        rctf viewplane;
                        float clipsta, clipend;
 
-                       int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, 
sizex, sizey, &viewplane, &clipsta, &clipend);
+                       int is_ortho = ED_view3d_viewplane_get(v3d, rv3d, 
sizex, sizey, &viewplane, &clipsta, &clipend, NULL);
                        if (is_ortho) orthographic_m4(winmat, viewplane.xmin, 
viewplane.xmax, viewplane.ymin, viewplane.ymax, -clipend, clipend);
                        else perspective_m4(winmat, viewplane.xmin, 
viewplane.xmax, viewplane.ymin, viewplane.ymax, clipsta, clipend);
                }

Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2013-05-25 
09:46:28 UTC (rev 57014)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt.c  2013-05-25 
11:52:52 UTC (rev 57015)
@@ -4935,7 +4935,7 @@
 
                BKE_paint_init(&ts->sculpt->paint, PAINT_CURSOR_SCULPT);
 
-               paint_cursor_start(C, sculpt_poll);
+               paint_cursor_start(C, sculpt_mode_poll_view3d);
        }
 
        WM_event_add_notifier(C, NC_SCENE | ND_MODE, scene);

Modified: trunk/blender/source/blender/editors/space_view3d/view3d_view.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/view3d_view.c     
2013-05-25 09:46:28 UTC (rev 57014)
+++ trunk/blender/source/blender/editors/space_view3d/view3d_view.c     
2013-05-25 11:52:52 UTC (rev 57015)
@@ -688,7 +688,7 @@
 
 /* also exposed in previewrender.c */
 bool ED_view3d_viewplane_get(View3D *v3d, RegionView3D *rv3d, int winx, int 
winy,
-                             rctf *r_viewplane, float *r_clipsta, float 
*r_clipend)
+                             rctf *r_viewplane, float *r_clipsta, float 
*r_clipend, float *r_pixsize)
 {
        CameraParams params;
 
@@ -699,6 +699,7 @@
        if (r_viewplane) *r_viewplane = params.viewplane;
        if (r_clipsta) *r_clipsta = params.clipsta;
        if (r_clipend) *r_clipend = params.clipend;
+       if (r_pixsize) *r_pixsize = params.viewdx;
        
        return params.is_ortho;
 }
@@ -713,7 +714,7 @@
        float clipsta, clipend, x1, y1, x2, y2;
        int orth;
        
-       orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, 
&viewplane, &clipsta, &clipend);
+       orth = ED_view3d_viewplane_get(v3d, rv3d, ar->winx, ar->winy, 
&viewplane, &clipsta, &clipend, NULL);
        rv3d->is_persp = !orth;
 
 #if 0

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to