DirectXTK icon indicating copy to clipboard operation
DirectXTK copied to clipboard

Mesh Outline Effect

Open pavledev opened this issue 2 years ago • 2 comments

Can outline effect be created for mesh like in Blender?

pavledev avatar May 14 '23 08:05 pavledev

Yes This is a method on how to do so: 1.) Write a shader that returns the outline color in the pixel shader. 2.) Modify the stencil state so the stencil buffer is not used. (The outline will be visible trough other objects in this case) 3.) Draw the coloured model with a bigger scale. 4.) Reset the stencil state. 5.) Draw the initial model.

NicusorN5 avatar May 14 '23 11:05 NicusorN5

Yes This is a method on how to do so: 1.) Write a shader that returns the outline color in the pixel shader. 2.) Modify the stencil state so the stencil buffer is not used. (The outline will be visible trough other objects in this case) 3.) Draw the coloured model with a bigger scale. 4.) Reset the stencil state. 5.) Draw the initial model.

Can you help me to implement code for that?

pavledev avatar May 14 '23 11:05 pavledev