UnitySimpleCartoonLine icon indicating copy to clipboard operation
UnitySimpleCartoonLine copied to clipboard

Some minor glitches

Open Dhrog opened this issue 4 years ago • 1 comments

Hello, I really like your project.

The is_outline check uses the centerpos of the first triangle for both triangle dot products. I am not sure if this is an intended approximation? Using the correct centerpos for triangle2 can avoid some popping inconsistencies here:

bool is_outline = 1-step(0.0, (dot(face1Normal, view_dirT1)) * (dot(face2Normal, view_dirT2)));

When the camera is inside the mesh the lines go crazy. This can be avoided by a depth check and moving them out of the culling frustum: e0.z = e0.z > 0.0 ? e0.z : 0; e1.z = e1.z > 0.0 ? e1.z : 0;

Depending on the mesh, moving the lines slightly towards the camera can be an improvement (instead of the normal extrusion): float mp = 0.999; float4 v0 = float4(e0.xy + n * 0.5 - ext, e0.z, mp) * input[0].vertex1.w;

Are you still working on the project? Looking forward to any improvements/new ideas you might implement. It would be awesome to have access to neighbour line segments. Imagine what you could do if each vertex had the information about it's (normalized) distance within a continuous line. This would be awesome for uv mapping and dynamic line widths, allowing a broader range of different npr styles. Hmm... maybe this would be possible in a multipass approach by calculating a link order index?

Dhrog avatar Oct 31 '21 05:10 Dhrog

It just is my hobby. Now I don't have much free time to do any more for it.

L-LingRen avatar Oct 31 '21 05:10 L-LingRen