Dashed material

Is there an example of a ‘dashed’ material I could look at?

I want to achieve something like this on a cylinder:

Hi. You could use ShaderMaterial and use mod function to create dashed pattern, where basically you discard some fragments based on that pattern.

I am kinda new to shaders myself, so this is a quick setup to give you an idea. I don’t know how this works to other types of objects, nor I know how to deal with top and bottom faces of the “cutout cylinders”

You can play with these values and check if it works for you => dashSize , gapSize, patternRepeat

1 Like

Here is an example… However I’ve realized it creates rings instead of multiple cylinder chunks. But maybe it helps somehow (I believe you have to add subdivisions and set the counters correctly)

EDIT: I’ve tried it. nope… :frowning: Makes sense after all.
You could create multiple cylinders and join them. Or you could create one cylinder and cut it out using CSG.

1 Like

Thanks! Both solutions work for me because i just want to create a dashed line which is like an arrow pointing in a direction. :slight_smile:

1 Like

@Mr_Anderson when you posted 3 weeks ago, I directly thought about a nice solution using Modulo operator, but at the time it was broken. It has been fixed by @Deltakosh last week, so now I can give my solution :grin:

Here :arrow_right: NME Template

Basically the idea is to combine a Modulo with a Greater Than.
By setting the 2 inputs MAX and MIDDLE you can basically control the height of the dashed alpha, as well as the ratio width. With MAX = 0.4 (height), you can have :
MIDDLE = 0.2;

MIDDLE = 0.1;

MIDDLE = 0.3;



1 Like