Bfg in das

To use daBfg inside daScript you need first of all compile daBfg library with DABFG_ENABLE_DAS_INTERGRATION = yes.

This will compile das module that you can import with require daBfg.bfg_ecs or require daBfg, whether you need ecs support or not.

DaScript daBfg methods are very similar to cpp methods, so usage will be the same, but with das syntax instead.

daBfg::registerNode registers node with provided name and declaration callback. Returns NodeHandle.

Declaration callback is a das lambda with one argument Registry. It returns execute lambda.

Inside declaration callback you describe node using registry argument.

Cpp declaration code

registry.orderMeAfter("some_node")
registry.requestRenderPass().color("rt_tex")

Will be in das

registry |> orderMeAfter("some_node")
registry |> requestRenderPass |> color([[auto "rt_tex"]])

Example:

require daBfg

def register_debug_visualization_node(var handle : NodeHandle& |#)
  handle <- root() |> registerNode(debug_visualization_node_name) <| @(var registry : Registry)
    if is_forward_rendering()
      registry |> requestRenderPass |> color([[auto[] "target_after_under_water_fog"]]) |> depthRo("depth_for_transparent_effects")
    else
      registry |> orderMeAfter("tracers_node")
      registry |> orderMeBefore("transparent_scene_late_node")
      registry |> requestRenderPass |> color([[auto[] "opaque_final_target"]]) |> depthRw("depth_for_transparency")

    registry |> requestState() |> setFrameBlock("global_frame")
    return <- @ <|
      worldRenderer_renderDebug()

Type aliases

VrsRateTexture is a variant type

some

daBfg::VirtualResourceSemiRequest

none

void?

|typedef-daBfg-VrsRateTexture|

VirtualAttachmentResource is a variant type

resUid

daBfg::ResUid

name

string

|typedef-daBfg-VirtualAttachmentResource|

TextureResolution is a variant type

res

tuple<x:uint;y:uint>

autoRes

daBfg::AutoResolutionRequest

|typedef-daBfg-TextureResolution|

NameSpaceRequest

NameSpaceRequest fields are

nameSpaceId

daBfgCore::NameSpaceNameId

nodeId

daBfgCore::NodeNameId

registry

daBfgCore::InternalRegistry ?

|structure-daBfg-NameSpaceRequest|

Registry

: NameSpaceRequest

Registry fields are

nameSpaceId

daBfgCore::NameSpaceNameId

nodeId

daBfgCore::NodeNameId

registry

daBfgCore::InternalRegistry ?

|structure-daBfg-Registry|

NameSpace

NameSpace fields are

nameSpaceId

daBfgCore::NameSpaceNameId

|structure-daBfg-NameSpace|

ResUid

ResUid fields are

nameId

daBfgCore::ResNameId

history

bool

|structure-daBfg-ResUid|

VirtualResourceRequestBase

VirtualResourceRequestBase fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualResourceRequestBase|

VirtualResourceHandle

VirtualResourceHandle fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

|structure-daBfg-VirtualResourceHandle|

VirtualResourceCreationSemiRequest

: VirtualResourceRequestBase

VirtualResourceCreationSemiRequest fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualResourceCreationSemiRequest|

VirtualResourceSemiRequest

: VirtualResourceRequestBase

VirtualResourceSemiRequest fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualResourceSemiRequest|

VirtualResourceRequest

: VirtualResourceRequestBase

VirtualResourceRequest fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualResourceRequest|

VirtualTextureHandle

: VirtualResourceHandle

VirtualTextureHandle fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

|structure-daBfg-VirtualTextureHandle|

VirtualBufferHandle

: VirtualResourceHandle

VirtualBufferHandle fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

|structure-daBfg-VirtualBufferHandle|

VirtualTextureRequest

: VirtualResourceRequest

VirtualTextureRequest fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualTextureRequest|

VirtualBufferRequest

: VirtualResourceRequest

VirtualBufferRequest fields are

registry

daBfgCore::InternalRegistry ?

resUid

daBfg::ResUid

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualBufferRequest|

StateRequest

StateRequest fields are

registry

daBfgCore::InternalRegistry ?

nodeId

daBfgCore::NodeNameId

|structure-daBfg-StateRequest|

VrsRequirements

VrsRequirements fields are

rateX

uint

rateY

uint

rateTexture

VrsRateTexture

vertexCombiner

daBfgCore::VariableRateShadingCombiner

pixelCombiner

daBfgCore::VariableRateShadingCombiner

|structure-daBfg-VrsRequirements|

VirtualPassRequest

VirtualPassRequest fields are

registry

daBfgCore::InternalRegistry ?

nodeId

daBfgCore::NodeNameId

|structure-daBfg-VirtualPassRequest|

VirtualAttachmentRequest

VirtualAttachmentRequest fields are

resource

VirtualAttachmentResource

mipLevel

uint

layer

uint

|structure-daBfg-VirtualAttachmentRequest|

AutoResolutionRequest

AutoResolutionRequest fields are

autoResTypeId

daBfgCore::AutoResTypeNameId

multiplier

float

registry

daBfgCore::InternalRegistry ?

|structure-daBfg-AutoResolutionRequest|

Texture2dCreateInfo

Texture2dCreateInfo fields are

resolution

TextureResolution

creationFlags

uint

mipLevels

uint

|structure-daBfg-Texture2dCreateInfo|

BufferCreateInfo

BufferCreateInfo fields are

elementSize

uint

elementCount

uint

flags

uint

format

uint

|structure-daBfg-BufferCreateInfo|

NamedSlot

NamedSlot fields are

name

string

|structure-daBfg-NamedSlot|

Top level functions

root()

root returns daBfg::NameSpace

|function-daBfg-root|

operator /(self: NameSpace; child_name: string const)

/ returns daBfg::NameSpace

argument

argument type

self

daBfg::NameSpace

child_name

string const

|function-daBfg-/|

fillSlot(self: NameSpace; slot: NamedSlot const; res_name_space: NameSpace const; res_name: string const)

argument

argument type

self

daBfg::NameSpace

slot

daBfg::NamedSlot const

res_name_space

daBfg::NameSpace const

res_name

string const

|function-daBfg-fillSlot|

registerNode(self: NameSpace; name: string const; declaration_callback: lambda<(var reg:daBfg::Registry -const):lambda<void>>)

registerNode returns daBfgCore::NodeHandle

argument

argument type

self

daBfg::NameSpace

name

string const

declaration_callback

lambda<(reg: daBfg::Registry ):lambda<>>

|function-daBfg-registerNode|

root(self: Registry)

root returns daBfg::NameSpaceRequest

argument

argument type

self

daBfg::Registry

|function-daBfg-root|

operator /(self: NameSpaceRequest; child_name: string const)

/ returns daBfg::NameSpaceRequest

argument

argument type

self

daBfg::NameSpaceRequest

child_name

string const

|function-daBfg-/|

Registry manipulation

orderMeBefore(self: Registry; name: string const)

orderMeBefore returns daBfg::Registry

argument

argument type

self

daBfg::Registry

name

string const

|function-daBfg-orderMeBefore|

orderMeBefore(self: Registry; names: array<string> const)

orderMeBefore returns daBfg::Registry

argument

argument type

self

daBfg::Registry

names

array<string> const

|function-daBfg-orderMeBefore|

orderMeAfter(self: Registry; name: string const)

orderMeAfter returns daBfg::Registry

argument

argument type

self

daBfg::Registry

name

string const

|function-daBfg-orderMeAfter|

orderMeAfter(self: Registry; names: array<string> const)

orderMeAfter returns daBfg::Registry

argument

argument type

self

daBfg::Registry

names

array<string> const

|function-daBfg-orderMeAfter|

setPriority(self: Registry; priority: int const)

setPriority returns daBfg::Registry

argument

argument type

self

daBfg::Registry

priority

int const

|function-daBfg-setPriority|

multiplex(self: Registry; multiplexing_mode: MultiplexingMode const)

multiplex returns daBfg::Registry

argument

argument type

self

daBfg::Registry

multiplexing_mode

daBfgCore::MultiplexingMode const

|function-daBfg-multiplex|

executionHas(self: Registry; side_effect: SideEffect const)

executionHas returns daBfg::Registry

argument

argument type

self

daBfg::Registry

side_effect

daBfgCore::SideEffect const

|function-daBfg-executionHas|

create(self: Registry; name: string const; history: History const)

create returns daBfg::VirtualResourceCreationSemiRequest

argument

argument type

self

daBfg::Registry

name

string const

history

daBfgCore::History const

|function-daBfg-create|

getResolution(self: NameSpaceRequest; type_name: string const; multiplier: float const)

getResolution returns daBfg::AutoResolutionRequest

argument

argument type

self

daBfg::NameSpaceRequest

type_name

string const

multiplier

float const

|function-daBfg-getResolution|

read(self: NameSpaceRequest; name: string const)

read returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

name

string const

|function-daBfg-read|

read(self: NameSpaceRequest; slot: NamedSlot const)

read returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

slot

daBfg::NamedSlot const

|function-daBfg-read|

history(self: NameSpaceRequest; name: string)

history returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

name

string

|function-daBfg-history|

modify(self: NameSpaceRequest; name: string const)

modify returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

name

string const

|function-daBfg-modify|

modify(self: NameSpaceRequest; slot: NamedSlot const)

modify returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

slot

daBfg::NamedSlot const

|function-daBfg-modify|

rename(self: NameSpaceRequest; from: string const; to: string const; history: History const)

rename returns daBfg::VirtualResourceSemiRequest

argument

argument type

self

daBfg::NameSpaceRequest

from

string const

to

string const

history

daBfgCore::History const

|function-daBfg-rename|

get(resolution: AutoResolutionRequest const)

get returns int2

argument

argument type

resolution

daBfg::AutoResolutionRequest const

|function-daBfg-get|

requestState(self: Registry)

requestState returns daBfg::StateRequest

argument

argument type

self

daBfg::Registry

|function-daBfg-requestState|

requestRenderPass(self: Registry)

requestRenderPass returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::Registry

|function-daBfg-requestRenderPass|

Request manipulation

texture(self: VirtualResourceCreationSemiRequest; info: Texture2dCreateInfo const)

texture returns daBfg::VirtualTextureRequest

argument

argument type

self

daBfg::VirtualResourceCreationSemiRequest

info

daBfg::Texture2dCreateInfo const

|function-daBfg-texture|

texture(self: VirtualResourceSemiRequest)

texture returns daBfg::VirtualTextureRequest

argument

argument type

self

daBfg::VirtualResourceSemiRequest

|function-daBfg-texture|

buffer(self: VirtualResourceCreationSemiRequest; info: BufferCreateInfo const)

buffer returns daBfg::VirtualBufferRequest

argument

argument type

self

daBfg::VirtualResourceCreationSemiRequest

info

daBfg::BufferCreateInfo const

|function-daBfg-buffer|

buffer(self: VirtualResourceSemiRequest)

buffer returns daBfg::VirtualBufferRequest

argument

argument type

self

daBfg::VirtualResourceSemiRequest

|function-daBfg-buffer|

blob(self: VirtualResourceSemiRequest)

blob returns daBfg::VirtualResourceRequest

argument

argument type

self

daBfg::VirtualResourceSemiRequest

|function-daBfg-blob|

modifyRequest(self: VirtualResourceRequest; modifier: block<(var request:daBfgCore::ResourceRequest -const):void> const)

argument

argument type

self

daBfg::VirtualResourceRequest

modifier

block<(request: daBfgCore::ResourceRequest ):void> const

|function-daBfg-modifyRequest|

handle(self: VirtualTextureRequest const)

handle returns daBfg::VirtualTextureHandle

argument

argument type

self

daBfg::VirtualTextureRequest const

|function-daBfg-handle|

handle(self: VirtualBufferRequest const)

handle returns daBfg::VirtualBufferHandle

argument

argument type

self

daBfg::VirtualBufferRequest const

|function-daBfg-handle|

view(handle: VirtualTextureHandle const)

view returns DagorResPtr::ManagedTexView

argument

argument type

handle

daBfg::VirtualTextureHandle const

|function-daBfg-view|

view(handle: VirtualBufferHandle const)

view returns DagorResPtr::ManagedBufView

argument

argument type

handle

daBfg::VirtualBufferHandle const

|function-daBfg-view|

setFrameBlock(self: StateRequest; name: string const)

setFrameBlock returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

name

string const

|function-daBfg-setFrameBlock|

setSceneBlock(self: StateRequest; name: string const)

setSceneBlock returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

name

string const

|function-daBfg-setSceneBlock|

setObjectBlock(self: StateRequest; name: string const)

setObjectBlock returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

name

string const

|function-daBfg-setObjectBlock|

allowWireFrame(self: StateRequest)

allowWireFrame returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

|function-daBfg-allowWireFrame|

allowVrs(self: StateRequest; vrs: VrsRequirements const)

allowVrs returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

vrs

daBfg::VrsRequirements const

|function-daBfg-allowVrs|

enableOverride(self: StateRequest; das_override: OverrideRenderState const)

enableOverride returns daBfg::StateRequest

argument

argument type

self

daBfg::StateRequest

das_override

DagorDriver3D::OverrideRenderState const

|function-daBfg-enableOverride|

color(self: VirtualPassRequest; attachments: array<daBfg::VirtualAttachmentRequest> const)

color returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::VirtualPassRequest

attachments

array< daBfg::VirtualAttachmentRequest > const

|function-daBfg-color|

optional(self: auto(TT))

optional returns TT

argument

argument type

self

auto(TT)

|function-daBfg-optional|

useAs(self: auto(TT); usageType: Usage const)

useAs returns TT

argument

argument type

self

auto(TT)

usageType

daBfgCore::Usage const

|function-daBfg-useAs|

atStage(self: auto(TT); stage: Stage const)

atStage returns TT

argument

argument type

self

auto(TT)

stage

daBfgCore::Stage const

|function-daBfg-atStage|

bindToShaderVar(self: auto(TT); name: string const)

bindToShaderVar returns TT

argument

argument type

self

auto(TT)

name

string const

|function-daBfg-bindToShaderVar|

color(self: VirtualPassRequest; requests: VirtualTextureRequest const[])

color returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::VirtualPassRequest

requests

daBfg::VirtualTextureRequest const[-1]

|function-daBfg-color|

color(self: VirtualPassRequest; names: string const[])

color returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::VirtualPassRequest

names

string const[-1]

|function-daBfg-color|

depthRw(self: VirtualPassRequest; attachment: auto const)

depthRw returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::VirtualPassRequest

attachment

auto const

|function-daBfg-depthRw|

depthRo(self: VirtualPassRequest; attachment: auto const)

depthRo returns daBfg::VirtualPassRequest

argument

argument type

self

daBfg::VirtualPassRequest

attachment

auto const

|function-daBfg-depthRo|