• Advertisement
Sign in to follow this  

Render a triangle with two different colors on two sides

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

Hi,

I have a triangle with two different colors on two sides.

One side is blue and the other side is red.

How to render it?

 

Many thanks.

 

YL

 

Share this post


Link to post
Share on other sites
Advertisement

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?

 

Thanks.

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.

A      

|  \       

B-C  

 

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

I see.

Many thanks.

Please ignore my second question.

It does not make sense.:-)

 

BTW, how to close this post since you already answer my question?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement