renderer improvements

Blender's renderer and external renderer export

Moderators: jesterKing, stiv

Post Reply
Posts: 86
Joined: Fri Oct 18, 2002 2:47 am

renderer improvements

Post by solmax »

a strange behaviour occurs to me everytime i render with edges turned on - non-silhouette edges are hardly visible, in certain situations even don't appear at all. this is definitely not intended, as lots of details are missing with flat shading or even toon shader.

of course i know that edge intensity can be pushed, but often i get undesired results - the mesh structure becomes visible on cetain areas.

will this issue be considered in future releases?

best regards

P.S.: I'll provide some images as soon as possible to illustrate the problem

Posts: 109
Joined: Tue Oct 15, 2002 11:43 pm

Post by cessen »

First of all, you might want to make your post's subject a bit more specific next time. Something like "edge rendering problems" would have been better.

The edge rendering problems you describe have been around for quite some time. I tried to improve it at one point, but the code was too confusing, and thus all the various code modifications I tried out on the system had very unintended effects.

I think that the edge rendering system simply needs to be re-written from scratch.

A good place to start in designing such as system is to consider the different types of edges that there are. I know of two major types of edges, and within each of those there are sub-types of edges:
  • 1) One type of edge is a silhouette edge. This type of edge happens either where the surface actually ends (which never happens on closed surfaces), or where the surface curves behind itself, hiding part of itself from the viewer. Thus, there are two subtypes of silhouette edges: ending edges and hider edges.

    (I just made up the "ending edges" and "hider edges" terms. I'm not sure what they're really called. And, quite frankly, "hider edges" is a horrible term, because the edges aren't hiding anything, rather, they indicate where self-hiding starts and ends.)

    With convex closed surfaces, these edges always lie on the outer-most part of the surface. However, with other surfaces, there can be inner silhouettes (for instance, the edge of a nose of a face from a 3/4 view, or a hole in a surface). Thus, there are two sub-sub-types of silhouette edges: outer and inner.

    That makes for a total of 4 sub-types of silhouette edges: ending outer, ending inner, hider outer, and hider inner. And note that hider edges are view-dependent.

    2) Another type of edge is a crease edge. A crease edge is a place on the surface that is not flat or curved, but sharply changes directions (for instance, the edges of a cube). This has two sub-types of edges: convex creases and concave creases (although, technically, if it's convex on one side, it's concave on the other, and vice versa).

    Not that these edges are not view dependent, except for whether or not they are hidden from view.
Generally, the two major types of edges should be dealt with separately. Right now, Blender has a fine system in place for detecting silhouette edges, but it has a seemingly non-existent system for crease edges, and it's system for drawing silhouette edges is not too great.

I think a good way to have the crease edge system work is to have min and max angles set by the user. Then the following is done:
  • 1) At any point on the edge there are two angles formed by the surfaces that meet there (the outer and the inner angle). The smaller of those two angles is found.

    2) If that angle is smaller than or equal to the min angle (meaning that it's at least as "sharp" as the min angle), then the edge is drawn with full thickness.

    3) If that angle is greater than or equal to the max angle, then no edge is drawn.

    4) If that angle is between the min and max angles, then an edge is drawn with a thickness that is interpolated between zero thickness (not drawn) and full thickness, based on where it is between the min and max angles.
This system would give the user a good deal of control not only over what creases are drawn, but also over how they taper off at their ends.

I don't have any ideas right now about drawing silhouette edges better.

Posts: 289
Joined: Wed Oct 16, 2002 2:38 am

Post by z3r0_d »


ok, object edges are hard
other edges can be visible, but aren't as thick.

I don't know, it appears that second category of edges, the darkness (??) is based on the angle of the fold between different faces, regardless of autosmooth, smooth, or whatever.


Posts: 289
Joined: Wed Oct 16, 2002 2:38 am

Post by z3r0_d »

I was reminded of an ati graphics card demo:

Non Photorealistic Rendering

(note that even the shadows have edges)

more screens that show a bit how it is done: ... rators.jpg ... rators.jpg

___ edit ___
I forgot to mention that the shadows are stencil shadows
(look it up, for refrence they are used in doom III)
which are probably faster than raytraced shadows, and make the edges on the shadow lines a lot easier to create.

well anyway it appears to use some sort of edge-detect code on those buffers (normal map, depth map) and then blur the result horzontally some and vertically some, resulting in the thickness of the line.

I don't they have anything on it on the developer site though, bummer

Post Reply