13
\$\begingroup\$

I want to make sketch shader like life strange.

shader has two part:

1.animated dashed line

2.noisy outline

I like to know how can I make noisy outline?

see outline of objects

record_2019_01_21_09_43_07_10

record_2019_01_21_09_51_00_896

record_2019_01_21_09_45_53_942

record_2019_01_21_11_37_27_699

First I tried to make outline by copying of incoming vertex data and scaled according to normal direction then Cull Back.but I think it's something like Image effect because outline sometimes move inside of object. anyway I will appreciate if someone help me to Implement this shader :)

What I tried

I used edge detection and animate it by vertex shader but this isn't good like above gifs.

record_2019_01_21_18_16_43_440

record_2019_01_21_18_27_28_597

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

I've done something similar in Unreal Engine 4, so I'm going to explain just the concepts. There are 2 ways you can do that, and they are different gradients of tradeoffs between performance and ease of implementation.

  1. First, add a new mesh on top of the main mesh, just a little bigger (just like a physical collider mesh). Then create a transparent material shader for it and enable the shader/show the mesh as the player's view frustum is within x distance units from the entity. This is performance heavy because of the transparency shader, but since you only have a small set of objects highlighted at a certain point, it is easy to implement and feasible.

  2. Create a base texture with the hash lines, and displace the texture coordinates according to a pre-determined set of matrices. This creates the illusion of "animated textures"; in the industry, it is also called a dynamic material (there's more to it, but you can read up if you want to). As for the outline, you can find plenty of tutorials on the web. This technique takes significantly more time to implement, since you have to tinker with the displacement matrices and the material update time to get a result similar to the above screenshots, not to mention having to allign the hash lines on angle changes in the base mesh.

If performance is not an issue, go with 1. If every FPS counts, use 2, but expect a lot of issues that take time to solve.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .