Sign in to follow this  

Render a triangle with two different colors on two sides

Recommended Posts

Thanks galop1n!

I have two questions regarding the first method you mentioned.

One is how to define the front triangle. Let's say I have a sphere and I want to define the internal surface as the front surface. Using anticlockwise order?

The other one is how to change pipeline status in pixel shader?



Share this post

Link to post
Share on other sites

front face and back face are defined by the winding order of the points in the index buffer,


In the triangle below (admire my ascii art skill), if the index buffer is ABC, then you need to set the culling front face as counter clockwise, but if your index buffer is ACB, then the front face is clockwise.


|  \       



In D3D11_RASTERIZER_DESC, it is the member FrontCounterClockwize and CullMode to set to NONE so both side are drawn.


And i don't understand your question about pipeline status in the pixel shader :)

Share this post

Link to post
Share on other sites

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