How to use both D3DFILL_SOLID and D3DFILL_WIREFRAME in one mesh?

Started by
7 comments, last by lglabc 18 years, 3 months ago
I want to show a mesh both in D3DFILL_WIREFRAME and D3DFILL_SOLID effect. Only I can figure out is to render the mesh twice -_-! Once use pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID ); Then pd3dDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_WIREFRAME ); Is there some better method to get the effect? ThX..
I''m a flying panda!
Advertisement
I'm afraid that for the "wireframe over solid" look you will have to render your mesh twice. No way around it really. (Unless your mesh is uniquely mapped and you draw the lines directly onto the texture - although this will generally look crap).

At least the wireframe pass is low on fill rate!

Mike.
oh....

Ok, thanks for your help!
I''m a flying panda!
you can do that with a keypressed...in fact I did it like that...
I have a mesh when I pressed F for example, it renders with solid and then again when pressed F it renders in wireframe...
wake up your sleepin' brains...
I mean I need the solid effect and the wireframe effect in the same time, not switch them.
I''m a flying panda!
ummm I would have thought if you´re using shaders you can have two passes, one with fillmode set to solid, and another with fillmode set to wireframe.

any reason why that wouldn´t work?
Quote:Original post by Rebuto
ummm I would have thought if you´re using shaders you can have two passes, one with fillmode set to solid, and another with fillmode set to wireframe.

any reason why that wouldn´t work?


What you describe is rendering the model twice (i.e. in two passes), and that's what lglabc was asking about.

I see how this is ambiguous -

"rendering an object" - As in rendering the object's geometry once to the screen with a specific set of states (A "pass")

vs.

"rendering an object" - As in rendering an object using a series of passes.

Just different people's terminology - there are probably flamewars over this sort of thing! lol.

Mike.
When drawing with D3DFILL_WIREFRAME over solids, you may want to use some depth-bias to make it look nice. Check out this thread.
Dustin Franklin ( circlesoft :: KBase :: Mystic GD :: ApolloNL )
That's very helpful about depth-bias!

Thx ^_^
I''m a flying panda!

This topic is closed to new replies.

Advertisement