Fill the area with color

I would like to achieve an effect in XNA where I move the clipping plane through an object and the object fades out. While the cropped area is filled with custom color or texture.

This is what I was able to achieve through HLSL:

enter image description here

And this is what I really need:

enter image description here

I think the kettle is not a good example, because the models that I would use would always be completely closed at all times.

Are there any good solutions for this?

+4
source share
1 answer

I think that if you just calculated that the pixel is in front or behind, you do not need to crop it, if the pixel is in front, you only need to set the normal normal to the normal plane value and calculate the light as usual ...

0
source

Source: https://habr.com/ru/post/1441604/


All Articles