Sign in to follow this  

Outlines on edges.

This topic is 662 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 have a lot of geometry with per-vertex position and normal.

I would like to render outlines on edges with significant difference in per-face normals like on right geometry.

I am looking for solution to render the outlines with variable thickness (not wireframe mode).

 

[attachment=30745:Outlines.png]

Are there any ways to implement it?

 

If it useful, I am using D3D11.

 

Thanks in advance.

Edited by Happy SDE

Share this post


Link to post
Share on other sites

Thank you, Swiftcoder.

 

It seems the algorithm is not what I am looking for: it describes how to render wireframe.

Please take a look on a right geometry on my picture: there is no outline between 2 triangles on a top.

I am looking for solution how to make outlines on significant edges, not on all edges.

Edited by Happy SDE

Share this post


Link to post
Share on other sites


I am looking for solution how to make outlines on significant edges, not on all edges.

The algorithm I indicated gives you the tools to render variable width edges. Choosing which edges is up to you.

 

Off the top of my head, if by "significant edges" you mean hard edges, then you should just be able to select edges that have a significant change in normal direction.

Share this post


Link to post
Share on other sites

So algorithm would look like this:

1. For each frame

2.     For each geometry

3.         For each triangle

3.1           Find sides of the triangle needed to be outlined

3.2           Render outlines on chosen edges.

 

It seems a lot of computation for real time rendering.

 

I think it's better to precompute some info and store it as per-vertex data.

I think [3.1] should be precomputed for sure.

 

So, [somehow] I need to find for each model edges with big difference between normals.

if I have per-vertex data about outlines I need to render: v0<->v1 + v1<->v2

[attachment=30747:Outlines2.png]

Also I have size of a triangle (in object space) => I can find absolute outline coordinates.

 

What is the best way to encode this information as per-vertex data?

I would like to minimize computation in runtime.

 

Probably it should be look like:

1. Vertex shader receives this value

2. Pixel shader applyes [a texture?] on each pixel of the triangle.

Share this post


Link to post
Share on other sites

So algorithm would look like this:
1. For each frame
2.     For each geometry
3.         For each triangle
3.1           Find sides of the triangle needed to be outlined
3.2           Render outlines on chosen edges.
 
It seems a lot of computation for real time rendering.


Only if you're doing all that on the CPU. A GPU can chew through those kinds of calculations very very quickly.

I would like to minimize computation in runtime.


Do remember that in with modern architectures, memory access can often be more expensive than computation. The cost of transmitting and accessing precomputed values needs to be weighed against the measured cost of the computations on target hardware.

I'd start with the GPU solution, measure it, then _try_ the precomputed approach as an experimental optimization, and see if it really does help or not (remember to try it at scale in a complex scene with complex objects so that you aren't getting fooled by a microbenchmark).

Share this post


Link to post
Share on other sites

This topic is 662 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