Orange: Node previews now draw standard backdrop to show alpha better.

This commit is contained in:
Ton Roosendaal
2006-01-04 12:41:13 +00:00
parent 3153a238b3
commit ec01a66a6b
2 changed files with 22 additions and 1 deletions

View File

@@ -647,6 +647,27 @@ static void socket_circle_draw(float x, float y, float size, int type, int selec
static void node_draw_preview(bNodePreview *preview, rctf *prv)
{
float scale= (prv->xmax-prv->xmin)/((float)preview->xsize);
float centx= prv->xmin + 0.5*(prv->xmax-prv->xmin);
float centy= prv->ymin + 0.5*(prv->ymax-prv->ymin);
/* draw standard bacdrop to show alpha */
glBegin(GL_TRIANGLES);
glColor3f(0.625f, 0.625f, 0.625f);
glVertex2f(prv->xmin, prv->ymin);
glVertex2f(prv->xmax, prv->ymin);
glVertex2f(centx, centy);
glVertex2f(prv->xmin, prv->ymax);
glVertex2f(prv->xmax, prv->ymax);
glVertex2f(centx, centy);
glColor3f(0.25f, 0.25f, 0.25f);
glVertex2f(prv->xmin, prv->ymin);
glVertex2f(prv->xmin, prv->ymax);
glVertex2f(centx, centy);
glVertex2f(prv->xmax, prv->ymin);
glVertex2f(prv->xmax, prv->ymax);
glVertex2f(centx, centy);
glEnd();
glPixelZoom(scale, scale);
glEnable(GL_BLEND);

View File

@@ -1013,7 +1013,7 @@ static void shade_lamp_loop_preview(ShadeInput *shi, ShadeResult *shr)
if(inp>1.0f) inp= 1.0f;
shr->alpha= (1.0f-inp)*shr->alpha+inp;
}
}
}
}
static void shade_preview_pixel(ShadeInput *shi, float *vec, int x, int y, char *rect, short pr_rectx, short pr_recty)