Jump to content
  • Advertisement
Sign in to follow this  
andyb716

Outlining VertexBuffer?

This topic is 5148 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
Advertisement
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 Lee_
Coder, I don't think there's a function in DirectX for line width, even in wireframe mode.

My bad, I should've looked closer. Though you can control line width using ID3DXLine, this won't work for what the article's doing.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!