Sign in to follow this  

Outlining VertexBuffer?

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've seen some programs outline a vertex buffer that is selected. But I don't know how there doing it. Do I have to draw a line around it or is it some special way of using DrawPrimitive();

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
You can either:

a) draw lines around the object or
b) use the idea stated in that article (I didn't read the entire thing but it appears they use a stencial buffer to draw over the edges of the primitive).

Share this post


Link to post
Share on other sites
Coder, I don't think there's a function in DirectX for line width, even in wireframe mode.

However, there is such a way of doing it (which I just learned in order to use stencil shadowing); but you'll need to store triangle edge indices, including the triangles that include those edges. It's probably too much work if you wanted to randomly add the feature... but anyways, for each triangle, if the triangle is facing away ( ViewDir.TriangleNormal > 0 ) then for each edge, add the edge to a list. If an edge is a duplicate, remove the edge completely because two triangles' edges of which face away will be an inner edge. Now you'll have to find a way of rendering those edges into triangle lists... but as I said it's, too much work (it also won't be a perfect outline).

There's also a certain shader that comes with RenderMonkey, which shows all sorts of techniques for NPR (nonphoto realistic), specifically huge outlines. Probably isn't worth it.

-> Probably the most simple way would be to render as normal, then scale out a bit, reverse the culling order, now render with your own diffuse color and without its texture. This would probably work, haven't tested it though. But in my head, all seems ok.

Share this post


Link to post
Share on other sites
Quote:
Original post by Coder
ID3DXLine


and I didn't even know about that. omg, this api has everything... just when I thought D3DXCreateVolumeTextureFromFileInMemoryEx was the last thing that I'd ever know about, lol.

Share this post


Link to post
Share on other sites

This topic is 4836 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this