New Renderer in town - Update 11/11 First functional test renders

For 10 looong years I’ve whined about how Blender doesn’t have a wire render with hidden line removal. And about 8 years into my wait :eek: I suspected just maybe I couldn’t convince anyone to take it on. So I’ve decided to tackle it myself.

So, I grabbed a copy of 2.5 and started digging. Now let me stop right here and say Kudos time infinity to the Blender developers. Three cheers and all that! I like what I’m seeing (and I don’t mean the UI – although I like that too so far).

Still work left to do like using actual camera data, line drawing, and of course the hidden line culling but is where I managed to get just tonight starting from ground zero. As I say, no lines yet but points are (in green).

[ Click Image to enlarge ]

Guess halo’s with a small light just didn’t cut it for you?

@nicktechyguy: how would you do a LINE renderer with halo’s? I guess you didn’t really read the OPs post too well…

@FourMadMen: I like the idea of the renderer and look forward to it :slight_smile:



This would be an excellent feature. It’s a pain having to do it by compositing viewport renders with no AA.

If I understand right you can have two meshes, one with a wire material and a ztransparent offset and the other with a solid material. Is that what you mean?

(nude untextured torso model warning)

From Blender 2.49 in one single render and has been available for ages. Would be nice to have in the one material option though. Nice, but it’s only a little extra work at the moment. If I understand you right of course.

BenDansie: If I understand correctly this is the actual solution for wireframe renders. FourMadMan is working on a “new and simpler” way to achieve the same result (via another simple render engine). I think it’s a cleaner solution: you have not to duplicate mesh to do this anymore.

Yeah, I figured that was the case. But didn’t want to risk someone learning extra code to do something they didn’t realise was already do-able. All for Blender’s renderer learning new tricks. :slight_smile:

Can we call this renderer, “Vectrex” ?

I only mentioned it cause he said “Blender doesn’t have a wire render with hidden line removal” and showed his render with just a bunch of dots…

Sorry for the simpleton approach.

FourMadMan It would be veeery appreciated if you can share with us details about your experience with render API. Wiki unfortunately is lacking about real examples and tips…

I think he means a wire renderer, but the wires on the backside get culled.

That is correct. The image above is not the final product. Just what I managed to accomplish last night when starting. Spent most of the time slogging through math papers posted on the internet.

I’ll table my reply on what I’m seeing internally until I’ve managed a bit more progress.

I’ve long wanted this feature as the two mesh-z-offset method is way to much like work for me. Still not too late for some happy dev to come along and add hidden-line removal to the wire render in Blender itself. But failing that, let’s continue…

Here’s an updated image of an Orthogonal projection:
Orthographic Projection

And there is nothing like math to give you a little perspective:
Perspective Projection

My original plan for finishing up (now that I’ve slogged through all the math) was to (1) Project the points to view plane and then (2) Use the edge data to connect those points. However now that I’ve slept on it I think I will save myself some trouble and modify things such that I’m using edge data to (1) Project the edge and (2) connect the points of the edge. This seems to make more sense given that the new Blender supports N-gons and the culling calculation operates on lines anyway.

This would be very much welcomed, especially if this can be used to render solid wireframes (including the materials and textures.). Good luck and keep at it.

More progress. Some code cleanup and refactor for handling edges. I have, I guess, more or less at this stage created a functioning wireframe renderer.

Orthographic Wireframe

Perspective Wireframe

Now to the culling (and more math paper reading) so the wireframes look solid and not transparent.

Brain hurts from hidden line removal algorithms. Culling layer will operate on face data and will either send line as is to line drawing function, crop it and then send to be drawn, or exclude all together. No coding on it yet.

But I did clean up some code and work up the UI. Which included calibrating the user settings of this renderer with the Blender internal one (i.e. Orthographic Scale and Lens Angle). So here’s the final update for the weekend.

  1. Render all scene objects using active camera setup data. (Fig. 1)

  2. Render with user selected perspective setup. (Fig. 2)

  3. Render with user selected orthographic setup. (Fig. 3)

  4. And finally you can set it to only render selected objects. (Fig. 4)

Personally I think the viewport renderer is pretty good for getting a decent wire render (just enable wire in the draw extra panel in object settings) especially since I have hardware antialiasing, but i guess your project is good from a learning point of view since you actually get to know how the shading works:)

What do you do if you need a wire render that is larger than your screen resolution?

New work: Added a Wire settings panel.

From this new panel you can set the color of the wireframe as well as turning AA on/off (see example output below).

First version of hidden algo is a “cheap” full occlusion check. Needs some work as there are faces being ignored that should not be. Will fine tune later when I have more time but this first step was quicker than the AA work (which itself will be improved as I go).

Click for full size

look up the code for blenders zclipping feature thats in edit mode