wireframe mode per object/mesh

Started by raft, September 29, 2007, 07:52:24 PM

Previous topic - Next topic

raft

hello,

is it possible to add support for rendering only some objects in wireframe mode ? it may be great for special effects or for helpers like grids, trajectories etc. it may even be greater if such a mode supports optionally not rendering hidden vertices/edges (just like a regular render)

i guess this can be emulated by making all other objects invisible and rendering in wireframe mode to same framebuffer but this emulation ignores hidden status vertices/edges

thanks,
r a f t

Klaudiusz

I think, everything what You can do is to make a differend World for wireframed objects. You need to disable Curling if You want to show hidden lines. Wireframe drawing should use Z-Buffer. If so, just render the secound World as wireframe after the main World- than if Your object is covered by other - won't be drawn (z-buffer walue will  be bigger). It's a little complicated, but drawWireframe is a World method only.

raft

Quote from: Klaudiusz on September 29, 2007, 08:21:33 PM
Wireframe drawing should use Z-Buffer.
not really. i dont know the technical details but wireframe mode doesnt take hidden surfaces into account. just run the fps demo and toggle wireframe mode. you will see walls behind others are rendered too.

Quote from: Klaudiusz on September 29, 2007, 08:21:33 PM
You need to disable Curling if You want to show hidden lines.
culling is something different. it's not for showing/hiding hidden polygons but showing/hiding polygons facing other side. normally a simple plane which looks in the direction of camera (its normal vector is in camera direction's semi-space) wont be rendered as it faces other side. if you disable culling on that plane it will be rendered regardless of wherever it's facing. of course it can be hidden by another object but it's another story..

Quote from: Klaudiusz on September 29, 2007, 08:21:33 PM
..what You can do is to make a differend World for wireframed objects.
you are right about that, that's another way of that emulation. instead of making other objects invisible one can put a copy of wireframed objects into another world

r a f t

EgonOlsen

I'm not sure how well this fits into the pipeline. I'll look into it, when i find the time.

stormp


Melssj5

I am interested in this too. How to render just some objetc in wireframe mode or in a combinated mode. Maybe rendering it as normal and then overwritting the buffer with the wireframe render and then displaying it. ANy way to do it?
Nada por ahora

LeoMaheo

I'm also interested in rendering only some objects in wireframe.

The reason is I want to draw X recent postures of a ragdoll,
to simplify debugging of ragdoll-walking-code.
I believe I'd rather draw these postures in wireframes
(otherwise they tend to overlap and hide each other and other graphics).

( I'm a bit surprised there's a public function
IRenderer.drawWireframe(VisList visList, int ind, int color, FrameBuffer buffer)
but no way to obtain the relevant IRenderer instance ?? )

( Perhaps I should use the line-drawing-code provided in "createLine3D" here:
http://www.jpct.net/forum2/index.php/topic,1091.0.html
and draw a box-of-lines. )

(I hope you don't mind me waking this old thread :-)  )

EgonOlsen

The method in the IRenderer interface wouldn't help, because it refers to the visibility list, not to a single object. With the default pipeline, wireframe per object just isn't possible in a reasonable way at render time. With the compiled pipeline in the 1.18 beta, it should be possible somehow if the object has been compiled.
Something that will work for both (but is a bit ugly), is to render the World twice. Once in normal mode with all objects visible. Then, iterate through all world objects, store their visibility, set them to invisible except for the ones that you want to render in wireframe, render the world again and draw it in wireframe, reset all world objects to the correct visibility. It's ugly, but once wrapped into a small method that will take care of these steps, it should be pretty easy to use...it won't be very fast, but it should be sufficient for debugging purposes.

LeoMaheo

Quote from: EgonOlsen on April 05, 2009, 12:15:22 AM
Something that will work for both (but is a bit ugly), is to render the World twice. Once in normal mode with all objects visible.
Then, iterate through all world objects, store their visibility,
set them to invisible except for the ones that you want to render in wireframe,
render the world again and draw it in wireframe,
reset all world objects to the correct visibility.

I did that, works fine (although wireframes are rendered on top of everything else), thanks.