Jump to content
  • Advertisement
Sign in to follow this  
XVincentX

What is capping?

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

Advertisement
When you extrude the silhouette edges of a mesh to create a shadow volume you need to put a 'cap' on the end of the extrusion to make a solid (closed) volume. The "cap triangles" are the triangles you need to create after the extrusion to cap the end of the volume.
If you didn't cap the volume then you would get incorrect shadow results when viewed from some angles.

Have a look at this thread.

hope that helps

Share this post


Link to post
Share on other sites
Hello again, i tried to make capping in a lot of ways, but my best result is this
megafaffo

How can i "turn" the polygones on the right side??
I tried (like a chicken) to add the same polygons used in the first capping but with the -

output.Pos = mul(mul(input[0].Pos,ViewMatrix),ProjMatrix);
Stream.Append(output);
output.Pos = mul(mul(input[2].Pos,ViewMatrix),ProjMatrix);
Stream.Append(output);
output.Pos = mul(mul(input[4].Pos,ViewMatrix),ProjMatrix);
Stream.Append(output);

Stream.RestartStrip();

output.Pos = mul(mul(input[4].Pos + ExtrudeValue * float4(normalize(LightDirection.xyz),0),ViewMatrix),ProjMatrix);
Stream.Append(output);
output.Pos = mul(mul(input[2].Pos + ExtrudeValue * float4(normalize(LightDirection.xyz),0),ViewMatrix),ProjMatrix);
Stream.Append(output);
output.Pos = mul(mul(input[0].Pos + ExtrudeValue * float4(normalize(LightDirection.xyz),0),ViewMatrix),ProjMatrix);
Stream.Append(output);

Stream.RestartStrip();




This code gives me image results.
I tried with the same code, but with - before first mul, but it does not work (and now i understand why)

Share this post


Link to post
Share on other sites
Why do you pretend to use D3D10 and then fall back to a TNT-era method?
You're asking for D3D10 hardware, use it.
Don't cap. Clamp.
Depth clamping is supported since NV2x and finally makes its appearance as a standard functionality. Capping is no more needed.

Share this post


Link to post
Share on other sites
Hello and thanks for your answer.

I've not understood how and why use depth bias.
I need to cap polygones, but as i've read, DepthBias (mabye for my wrong english) it's only a way to avoid complanar polygons in 3D space.

And so? How can this help me in capping? Could you explain me it?

Anyway, if i would make a test, how should i set

INT DepthBias;
FLOAT DepthBiasClamp;
FLOAT SlopeScaledDepthBias;


these values?

Thank you.

Share this post


Link to post
Share on other sites
Quote:
Original post by XVincentX
I've not understood how and why use depth bias.
I need to cap polygones, but as i've read, DepthBias (mabye for my wrong english) it's only a way to avoid complanar polygons in 3D space.

Neither do I.
Clamping has nothing to deal with bias. The field you're searching is BOOL D3D10_RASTERIZER_DESC::DepthClipEnable.
Just set it to false and activate the raster state. Done.

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!