# What is capping?

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

## Recommended Posts

In the Z-Fail shadow volume method, what is the capping? what does it means "cap triangles?"

##### Share on other sites
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 on other sites
Hello again, i tried to make capping in a lot of ways, but my best result is this

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)

No help for me?

##### 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 on other sites

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 on other sites
Please! Really noone can give me help?

Heeelp!!

##### Share on other sites
Quote:
 Original post by XVincentXI'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.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 9
• 31
• 16
• 11
• 10
• ### Forum Statistics

• Total Topics
634122
• Total Posts
3015622
×