fabre.cedric Posted September 4, 2020 Share Posted September 4, 2020 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 :). filter_hidden_faces.frag post_filter_hidden_faces.basemat Link to comment
morbid Posted September 9, 2020 Share Posted September 9, 2020 Hello, we've made a progress recently on this. More likely, the desired effect can be achieved with default normal maps only. I'll send you sample code by tomorrow. Thanks for the patience. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
morbid Posted September 9, 2020 Share Posted September 9, 2020 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. filter_sobel_depth.frag How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
fabre.cedric Posted September 9, 2020 Author Share Posted September 9, 2020 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. 1 Link to comment
fabre.cedric Posted September 10, 2020 Author Share Posted September 10, 2020 The right way for me appear to be to not use the geLlinearDepth. But now that work perfect ! Many thanks :) filter.frag 4 Link to comment
Recommended Posts