Orange bug: forgot to restore inverse matrix calculus for OpengGL render

in a window... didn't know what it was for, but now I do! It uses the
inverse to do pre-clipping on objects.
This commit is contained in:
Ton Roosendaal 2006-01-24 17:07:39 +00:00
parent 26b718654d
commit 9a20e5466c
4 changed files with 28 additions and 21 deletions

@ -216,22 +216,23 @@ static int node_buts_rgb(uiBlock *block, bNodeTree *ntree, bNode *node, rctf *bu
{ {
if(block) { if(block) {
bNodeSocket *sock= node->outputs.first; /* first socket stores value */ bNodeSocket *sock= node->outputs.first; /* first socket stores value */
if(sock) {
/* enforce square box drawing */
uiBlockSetEmboss(block, UI_EMBOSSP);
/* enforce square box drawing */ uiDefButF(block, HSVCUBE, B_NODE_EXEC, "",
uiBlockSetEmboss(block, UI_EMBOSSP); butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12,
sock->ns.vec, 0.0f, 1.0f, 3, 0, "");
uiDefButF(block, HSVCUBE, B_NODE_EXEC, "",
butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15,
sock->ns.vec, 0.0f, 1.0f, 2, 0, "");
uiDefButF(block, COL, B_NOP, "",
butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12,
sock->ns.vec, 0.0, 0.0, -1, 0, "");
/* the -1 above prevents col button to popup a color picker */
uiDefButF(block, HSVCUBE, B_NODE_EXEC, "", uiBlockSetEmboss(block, UI_EMBOSS);
butr->xmin, butr->ymin, butr->xmax-butr->xmin, 12, }
sock->ns.vec, 0.0f, 1.0f, 3, 0, "");
uiDefButF(block, HSVCUBE, B_NODE_EXEC, "",
butr->xmin, butr->ymin+15, butr->xmax-butr->xmin, butr->ymax-butr->ymin -15 -15,
sock->ns.vec, 0.0f, 1.0f, 2, 0, "");
uiDefButF(block, COL, B_NOP, "",
butr->xmin, butr->ymax-12, butr->xmax-butr->xmin, 12,
sock->ns.vec, 0.0, 0.0, -1, 0, "");
/* the -1 above prevents col button to popup a color picker */
uiBlockSetEmboss(block, UI_EMBOSS);
} }
return 30 + (int)(node->width-NODE_DY); return 30 + (int)(node->width-NODE_DY);
} }

@ -2389,6 +2389,7 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy)
{ {
Base *base; Base *base;
Scene *setscene; Scene *setscene;
float winmat[4][4];
update_for_newframe_muted(); /* first, since camera can be animated */ update_for_newframe_muted(); /* first, since camera can be animated */
@ -2396,9 +2397,12 @@ void drawview3d_render(struct View3D *v3d, int winx, int winy)
setviewmatrixview3d(); setviewmatrixview3d();
myloadmatrix(v3d->viewmat); myloadmatrix(v3d->viewmat);
// Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat); glMatrixMode(GL_PROJECTION);
// Mat4Invert(v3d->persinv, v3d->persmat); mygetmatrix(winmat);
// Mat4Invert(v3d->viewinv, v3d->viewmat); glMatrixMode(GL_MODELVIEW);
Mat4MulMat4(v3d->persmat, v3d->viewmat, winmat);
Mat4Invert(v3d->persinv, v3d->persmat);
Mat4Invert(v3d->viewinv, v3d->viewmat);
free_all_realtime_images(); free_all_realtime_images();
reshadeall_displist(); reshadeall_displist();

@ -1129,7 +1129,7 @@ static void node_add_menu(SpaceNode *snode)
} }
else if(snode->treetype==NTREE_COMPOSIT) { else if(snode->treetype==NTREE_COMPOSIT) {
/* compo menu, still hardcoded defines... solve */ /* compo menu, still hardcoded defines... solve */
event= pupmenu("Add Node%t|Output%x201|Render Result %x221|Image %x220|RGB Curves%x209|AlphaOver %x210|Blur %x211|Filter %x212|Value %x203|Color %x202|Mix %x204|ColorRamp %x205|Color to BW %x206|Normal %x207"); event= pupmenu("Add Node%t|Output%x201|Render Output%x202|Render Result %x221|Image %x220|RGB Curves%x209|AlphaOver %x210|Blur %x211|Filter %x212|Value %x203|Color %x202|Mix %x204|ColorRamp %x205|Color to BW %x206|Normal %x207");
if(event<1) return; if(event<1) return;
} }
else return; else return;

@ -1051,6 +1051,7 @@ void BIF_do_ogl_render(View3D *v3d, int anim)
if(anim) { if(anim) {
bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype); bMovieHandle *mh= BKE_get_movie_handle(G.scene->r.imtype);
int cfrao= CFRA;
mh->start_movie(&G.scene->r, winx, winy); mh->start_movie(&G.scene->r, winx, winy);
@ -1063,6 +1064,7 @@ void BIF_do_ogl_render(View3D *v3d, int anim)
if(test_break()) break; if(test_break()) break;
} }
mh->end_movie(); mh->end_movie();
CFRA= cfrao;
} }
else { else {
drawview3d_render(v3d, winx, winy); drawview3d_render(v3d, winx, winy);