Skip to content

GFX.Render

Name Mandatory Description Default Type
⬅️ Input The input of this shard is ignored. None
Output ➡️ This shard outputs none. None
Steps No Sequence of render pass objects to process. none Var([GFX.PipelineStep])[GFX.PipelineStep]
View No The view to render. If no view object is provided, the default view will be used. none NoneVar(GFX.View)

This shard takes the sequence of render pass objects specified in the Steps parameter, processes it sequentially, and renders the final scene based on the view object specified in the View parameter.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@wire(main-wire-graphics {
  Once({
    {State: {Culling: false}
     Shaders: [{Name: "z-discard"
                After: ["readColor"]
                Stage: ProgrammableGraphicsStage::Fragment
                EntryPoint: {
            Shader.ReadGlobal("color") | Take(3)
            When(Predicate: IsLess(0.2) Action: {
              Shader.Literal("discard;")
            })
          }}]}
    GFX.Feature >> features

    GFX.BuiltinMesh(Type: BuiltinMeshType::Cube) = cube
  })
  fbl/translation | Math.Translation = translation-matrix
  fbl/rotation | Math.Rotation = rotation-matrix
  fbl/scale | Math.Scaling = scale-matrix
  ; matmul them
  translation-matrix | Math.MatMul(rotation-matrix) | Math.MatMul(scale-matrix) >= transformation-matrix
  ; and feed to gltf renderer
  transformation-matrix
  GFX.Drawable(Features: features Mesh: cube Params: {baseColor: @f4(0.0 1.0 0.0 1.0)})
  @fbl/draw([])
} Looped: true)

{graphics-behavior: main-wire-graphics}

Image