Discard()
Function in Authoring
Push a discard; onto the innermost scope.
import { Discard } from 'typeshade'
The signature, the description and the examples come from the compiler's own source at commit 26de7be8.
Syntax
const Discard: () => voidReturn value
void
Description
Push a discard; onto the innermost scope. It ends the current fragment invocation with
no color or depth write, the fragment-only terminator of both WGSL and GLSL. It is
typically guarded by an If for a cull test: a backface, an alpha clip, an out-of-bounds
sample.
Examples
Example
If(cosC.lt(0), () => { Discard()})In the guide
Source
src/core/ir/builder.ts, line 1765, at commit 26de7be8