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).
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?
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.
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…
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…
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.
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.
Render all scene objects using active camera setup data. (Fig. 1)
Render with user selected perspective setup. (Fig. 2)
Render with user selected orthographic setup. (Fig. 3)
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:)
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).