I’m trying to achieve silhouette effect using the dot(N,V) equation, but my shader currently fails to draw the edges properly. Anyone see where the error could be located???
for smooth geo,the Dot(N,L) fall off smoothly,you can do some math trick,like pow(),for geo like cube, i dont think it can be done
Edit: and i think do that in fragment func will make it more smoothly
You probably want saturate(-dot(V,N)) ? Otherwise it’ll always come up black 'cause the view direction is facing away from your surface normal.
But doing that in the fragment shader with normalized vectors will give a smoother result. Also, if you want it constant sized, you’ll need to do something like;
-dot(V,N) / o.pos.w
Otherwise the effect increases and decreases as you get closerto /further from your object.