Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2003-11-08 19:57:23 +0300
committerTon Roosendaal <ton@blender.org>2003-11-08 19:57:23 +0300
commit7be1d02919d69313dfde692265b88571b3ee241f (patch)
treeffca6772dde295852f48fa5a03956ef7f30d7a48
parent96403dc309c24753f3f0ce9b6f1e55bf2feb42a7 (diff)
- bug fix #304
Wire rendering gave errors with parts. This due to the fact the lines are clipped exactly at the pixel centers of the image edge. For polys (triangles) that works fine, but in wireframe you see the lines ending at the edge. Solved by adjusting clipping routine for wires just a tinsy bit.
-rw-r--r--source/blender/render/intern/source/zbuf.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 1cbe015731a..608b274de41 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -1569,25 +1569,30 @@ static void clipp(float *v1, float *v2, int b1, int *b2, int *b3, int a)
static int clipline(float *v1, float *v2) /* return 0: do not draw */
{
float dz,dw, u1=0.0, u2=1.0;
- float dx, dy;
+ float dx, dy, v13;
dz= v2[2]-v1[2];
dw= v2[3]-v1[3];
+ /* this 1.01 is for clipping x and y just a tinsy larger. that way it is
+ filled in with zbufwire correctly when rendering in parts. otherwise
+ you see line endings at edges... */
+
if(cliptestf(-dz-dw, v1[3]+v1[2], &u1,&u2)) {
if(cliptestf(dz-dw, v1[3]-v1[2], &u1,&u2)) {
dx= v2[0]-v1[0];
- dz= v2[3]-v1[3];
-
- if(cliptestf(-dx-dz, v1[0]+v1[3], &u1,&u2)) {
- if(cliptestf(dx-dz, v1[3]-v1[0], &u1,&u2)) {
+ dz= 1.01*(v2[3]-v1[3]);
+ v13= 1.01*v1[3];
+
+ if(cliptestf(-dx-dz, v1[0]+v13, &u1,&u2)) {
+ if(cliptestf(dx-dz, v13-v1[0], &u1,&u2)) {
dy= v2[1]-v1[1];
- if(cliptestf(-dy-dz,v1[1]+v1[3],&u1,&u2)) {
- if(cliptestf(dy-dz,v1[3]-v1[1],&u1,&u2)) {
-
+ if(cliptestf(-dy-dz, v1[1]+v13, &u1,&u2)) {
+ if(cliptestf(dy-dz, v13-v1[1], &u1,&u2)) {
+
if(u2<1.0) {
v2[0]= v1[0]+u2*dx;
v2[1]= v1[1]+u2*dy;