<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@three3d/effect](./effect.md) &gt; [lengthDrawRange\_fragment\_mainReplace](./effect.lengthdrawrange_fragment_mainreplace.md)

## lengthDrawRange\_fragment\_mainReplace variable

lengthDrawRange 的片元着色器中增加的核心代码

**Signature:**

```typescript
lengthDrawRange_fragment_mainReplace = "\nuniform bool invert;\nuniform bool enableStart;\nuniform bool enableEnd;\n\nuniform float startLength;\nuniform float endLength;\nvoid main() {\n  bool startDiscard = enableStart && vLineDistance < startLength;\n  bool endDiscard = enableEnd && vLineDistance > endLength;\n  bool isDiscard = startDiscard || endDiscard;\n  if (invert){\n    isDiscard = !isDiscard;\n  }\n  if (isDiscard) discard;\n"
```
