Jump to content

Drawing edge with shader


photo

Recommended Posts

Hi,
I'm trying to made a post effect shader for drawing black edges and white faces for rendering.
My problem is when I have an attributed material with normalmap to the mesh, the screen space normal textures contains the normalmap informations of the material..

I don't know if I'm clear but I only whant black edges and white faces.
You can find my shader and material files for post effect and the screen that explain my problem.
I'm not sure about using the normalmap screen space texture correctly ?

Thanks for your help :).

HiddenFaces.png

HiddenFaces1.png

filter_hidden_faces.frag post_filter_hidden_faces.basemat

Link to comment

Here's the shader example.

We suggest researching post_filter_sobel, it provides a faster way to draw edges based on a final image. The algorithm used originally runs multiple cycles. That's kinda slow. Image can be tuned with threshold parameter.

Let us know what you're thinking on this.

 

image.png

filter_sobel_depth.frag

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Yes, your algorithm appear much faster and more precise !
I have just a small problem with this.
I think this is because my scene is scaled with 100 units.
And thanks to Unigine teams for his good work.

test.png

  • Like 1
Link to comment
×
×
  • Create New...