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 |
|
none |
void? |
|typedef-daBfg-VrsRateTexture|
- VirtualAttachmentResource is a variant type
resUid |
|
name |
string |
|typedef-daBfg-VirtualAttachmentResource|
- TextureResolution is a variant type
res |
tuple<x:uint;y:uint> |
autoRes |
|
|typedef-daBfg-TextureResolution|
- NameSpaceRequest
NameSpaceRequest fields are
nameSpaceId |
|
nodeId |
|
registry |
|
|structure-daBfg-NameSpaceRequest|
- Registry
: NameSpaceRequest
Registry fields are
nameSpaceId |
|
nodeId |
|
registry |
|
- NameSpace
NameSpace fields are
nameSpaceId |
|
- ResUid
ResUid fields are
nameId |
|
history |
bool |
- VirtualResourceRequestBase
VirtualResourceRequestBase fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualResourceRequestBase|
- VirtualResourceHandle
VirtualResourceHandle fields are
registry |
|
resUid |
|
|structure-daBfg-VirtualResourceHandle|
- VirtualResourceCreationSemiRequest
: VirtualResourceRequestBase
VirtualResourceCreationSemiRequest fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualResourceCreationSemiRequest|
- VirtualResourceSemiRequest
: VirtualResourceRequestBase
VirtualResourceSemiRequest fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualResourceSemiRequest|
- VirtualResourceRequest
: VirtualResourceRequestBase
VirtualResourceRequest fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualResourceRequest|
- VirtualTextureHandle
: VirtualResourceHandle
VirtualTextureHandle fields are
registry |
|
resUid |
|
|structure-daBfg-VirtualTextureHandle|
- VirtualBufferHandle
: VirtualResourceHandle
VirtualBufferHandle fields are
registry |
|
resUid |
|
|structure-daBfg-VirtualBufferHandle|
- VirtualTextureRequest
: VirtualResourceRequest
VirtualTextureRequest fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualTextureRequest|
- VirtualBufferRequest
: VirtualResourceRequest
VirtualBufferRequest fields are
registry |
|
resUid |
|
nodeId |
|
|structure-daBfg-VirtualBufferRequest|
- StateRequest
StateRequest fields are
registry |
|
nodeId |
|
|structure-daBfg-StateRequest|
- VrsRequirements
VrsRequirements fields are
rateX |
uint |
rateY |
uint |
rateTexture |
|
vertexCombiner |
|
pixelCombiner |
|
|structure-daBfg-VrsRequirements|
- VirtualPassRequest
VirtualPassRequest fields are
registry |
|
nodeId |
|
|structure-daBfg-VirtualPassRequest|
- VirtualAttachmentRequest
VirtualAttachmentRequest fields are
resource |
|
mipLevel |
uint |
layer |
uint |
|structure-daBfg-VirtualAttachmentRequest|
- AutoResolutionRequest
AutoResolutionRequest fields are
autoResTypeId |
|
multiplier |
float |
registry |
|
|structure-daBfg-AutoResolutionRequest|
- Texture2dCreateInfo
Texture2dCreateInfo fields are
resolution |
|
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 |
Top level functions
- root()
root returns daBfg::NameSpace
- operator /(self: NameSpace; child_name: string const)
/ returns daBfg::NameSpace
argument |
argument type |
---|---|
self |
|
child_name |
string const |
- fillSlot(self: NameSpace; slot: NamedSlot const; res_name_space: NameSpace const; res_name: string const)
argument |
argument type |
---|---|
self |
|
slot |
daBfg::NamedSlot const |
res_name_space |
daBfg::NameSpace const |
res_name |
string const |
- registerNode(self: NameSpace; name: string const; declaration_callback: lambda<(var reg:daBfg::Registry -const):lambda<void>>)
registerNode returns daBfgCore::NodeHandle
argument |
argument type |
---|---|
self |
|
name |
string const |
declaration_callback |
lambda<(reg: daBfg::Registry ):lambda<>> |
- root(self: Registry)
root returns daBfg::NameSpaceRequest
argument |
argument type |
---|---|
self |
|
- operator /(self: NameSpaceRequest; child_name: string const)
/ returns daBfg::NameSpaceRequest
argument |
argument type |
---|---|
self |
|
child_name |
string const |
Registry manipulation
orderMeBefore (self:daBfg::Registry -const;name:string const) : daBfg::Registry
orderMeBefore (self:daBfg::Registry -const;names:array<string> const) : daBfg::Registry
orderMeAfter (self:daBfg::Registry -const;name:string const) : daBfg::Registry
orderMeAfter (self:daBfg::Registry -const;names:array<string> const) : daBfg::Registry
setPriority (self:daBfg::Registry -const;priority:int const) : daBfg::Registry
executionHas (self:daBfg::Registry -const;side_effect:daBfgCore::SideEffect const) : daBfg::Registry
read (self:daBfg::NameSpaceRequest -const;name:string const) : daBfg::VirtualResourceSemiRequest
history (self:daBfg::NameSpaceRequest -const;name:string -const) : daBfg::VirtualResourceSemiRequest
modify (self:daBfg::NameSpaceRequest -const;name:string const) : daBfg::VirtualResourceSemiRequest
requestState (self:daBfg::Registry -const) : daBfg::StateRequest
requestRenderPass (self:daBfg::Registry -const) : daBfg::VirtualPassRequest
- orderMeBefore(self: Registry; name: string const)
orderMeBefore returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
name |
string const |
|function-daBfg-orderMeBefore|
- orderMeBefore(self: Registry; names: array<string> const)
orderMeBefore returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
names |
array<string> const |
|function-daBfg-orderMeBefore|
- orderMeAfter(self: Registry; name: string const)
orderMeAfter returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
name |
string const |
- orderMeAfter(self: Registry; names: array<string> const)
orderMeAfter returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
names |
array<string> const |
- setPriority(self: Registry; priority: int const)
setPriority returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
priority |
int const |
- multiplex(self: Registry; multiplexing_mode: MultiplexingMode const)
multiplex returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
multiplexing_mode |
|
- executionHas(self: Registry; side_effect: SideEffect const)
executionHas returns daBfg::Registry
argument |
argument type |
---|---|
self |
|
side_effect |
daBfgCore::SideEffect const |
- create(self: Registry; name: string const; history: History const)
create returns daBfg::VirtualResourceCreationSemiRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
history |
daBfgCore::History const |
- getResolution(self: NameSpaceRequest; type_name: string const; multiplier: float const)
getResolution returns daBfg::AutoResolutionRequest
argument |
argument type |
---|---|
self |
|
type_name |
string const |
multiplier |
float const |
|function-daBfg-getResolution|
- read(self: NameSpaceRequest; name: string const)
read returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
- read(self: NameSpaceRequest; slot: NamedSlot const)
read returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
slot |
daBfg::NamedSlot const |
- history(self: NameSpaceRequest; name: string)
history returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
name |
string |
- modify(self: NameSpaceRequest; name: string const)
modify returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
- modify(self: NameSpaceRequest; slot: NamedSlot const)
modify returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
slot |
daBfg::NamedSlot const |
- rename(self: NameSpaceRequest; from: string const; to: string const; history: History const)
rename returns daBfg::VirtualResourceSemiRequest
argument |
argument type |
---|---|
self |
|
from |
string const |
to |
string const |
history |
daBfgCore::History const |
- get(resolution: AutoResolutionRequest const)
get returns int2
argument |
argument type |
---|---|
resolution |
|
- requestState(self: Registry)
requestState returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
- requestRenderPass(self: Registry)
requestRenderPass returns daBfg::VirtualPassRequest
argument |
argument type |
---|---|
self |
|
Request manipulation
texture (self:daBfg::VirtualResourceSemiRequest -const) : daBfg::VirtualTextureRequest
buffer (self:daBfg::VirtualResourceSemiRequest -const) : daBfg::VirtualBufferRequest
blob (self:daBfg::VirtualResourceSemiRequest -const) : daBfg::VirtualResourceRequest
handle (self:daBfg::VirtualTextureRequest const) : daBfg::VirtualTextureHandle
handle (self:daBfg::VirtualBufferRequest const) : daBfg::VirtualBufferHandle
view (handle:daBfg::VirtualTextureHandle const) : DagorResPtr::ManagedTexView
view (handle:daBfg::VirtualBufferHandle const) : DagorResPtr::ManagedBufView
setFrameBlock (self:daBfg::StateRequest -const;name:string const) : daBfg::StateRequest
setSceneBlock (self:daBfg::StateRequest -const;name:string const) : daBfg::StateRequest
setObjectBlock (self:daBfg::StateRequest -const;name:string const) : daBfg::StateRequest
allowWireFrame (self:daBfg::StateRequest -const) : daBfg::StateRequest
allowVrs (self:daBfg::StateRequest -const;vrs:daBfg::VrsRequirements const) : daBfg::StateRequest
useAs (self:auto(TT) -const;usageType:daBfgCore::Usage const) : TT
atStage (self:auto(TT) -const;stage:daBfgCore::Stage const) : TT
bindToShaderVar (self:auto(TT) -const;name:string const) : TT
color (self:daBfg::VirtualPassRequest -const;names:string const[]) : daBfg::VirtualPassRequest
depthRw (self:daBfg::VirtualPassRequest -const;attachment:auto const) : daBfg::VirtualPassRequest
depthRo (self:daBfg::VirtualPassRequest -const;attachment:auto const) : daBfg::VirtualPassRequest
- texture(self: VirtualResourceCreationSemiRequest; info: Texture2dCreateInfo const)
texture returns daBfg::VirtualTextureRequest
argument |
argument type |
---|---|
self |
|
info |
|
- texture(self: VirtualResourceSemiRequest)
texture returns daBfg::VirtualTextureRequest
argument |
argument type |
---|---|
self |
|
- buffer(self: VirtualResourceCreationSemiRequest; info: BufferCreateInfo const)
buffer returns daBfg::VirtualBufferRequest
argument |
argument type |
---|---|
self |
|
info |
daBfg::BufferCreateInfo const |
- buffer(self: VirtualResourceSemiRequest)
buffer returns daBfg::VirtualBufferRequest
argument |
argument type |
---|---|
self |
|
- blob(self: VirtualResourceSemiRequest)
blob returns daBfg::VirtualResourceRequest
argument |
argument type |
---|---|
self |
|
- modifyRequest(self: VirtualResourceRequest; modifier: block<(var request:daBfgCore::ResourceRequest -const):void> const)
argument |
argument type |
---|---|
self |
|
modifier |
block<(request: daBfgCore::ResourceRequest ):void> const |
|function-daBfg-modifyRequest|
- handle(self: VirtualTextureRequest const)
handle returns daBfg::VirtualTextureHandle
argument |
argument type |
---|---|
self |
|
- handle(self: VirtualBufferRequest const)
handle returns daBfg::VirtualBufferHandle
argument |
argument type |
---|---|
self |
|
- view(handle: VirtualTextureHandle const)
view returns DagorResPtr::ManagedTexView
argument |
argument type |
---|---|
handle |
|
- view(handle: VirtualBufferHandle const)
view returns DagorResPtr::ManagedBufView
argument |
argument type |
---|---|
handle |
|
- setFrameBlock(self: StateRequest; name: string const)
setFrameBlock returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
|function-daBfg-setFrameBlock|
- setSceneBlock(self: StateRequest; name: string const)
setSceneBlock returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
|function-daBfg-setSceneBlock|
- setObjectBlock(self: StateRequest; name: string const)
setObjectBlock returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
name |
string const |
|function-daBfg-setObjectBlock|
- allowWireFrame(self: StateRequest)
allowWireFrame returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
|function-daBfg-allowWireFrame|
- allowVrs(self: StateRequest; vrs: VrsRequirements const)
allowVrs returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
vrs |
daBfg::VrsRequirements const |
- enableOverride(self: StateRequest; das_override: OverrideRenderState const)
enableOverride returns daBfg::StateRequest
argument |
argument type |
---|---|
self |
|
das_override |
DagorDriver3D::OverrideRenderState const |
|function-daBfg-enableOverride|
- color(self: VirtualPassRequest; attachments: array<daBfg::VirtualAttachmentRequest> const)
color returns daBfg::VirtualPassRequest
argument |
argument type |
---|---|
self |
|
attachments |
array< daBfg::VirtualAttachmentRequest > const |
- optional(self: auto(TT))
optional returns TT
argument |
argument type |
---|---|
self |
auto(TT) |
- useAs(self: auto(TT); usageType: Usage const)
useAs returns TT
argument |
argument type |
---|---|
self |
auto(TT) |
usageType |
daBfgCore::Usage const |
- atStage(self: auto(TT); stage: Stage const)
atStage returns TT
argument |
argument type |
---|---|
self |
auto(TT) |
stage |
daBfgCore::Stage const |
- 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 |
|
requests |
daBfg::VirtualTextureRequest const[-1] |
- color(self: VirtualPassRequest; names: string const[])
color returns daBfg::VirtualPassRequest
argument |
argument type |
---|---|
self |
|
names |
string const[-1] |
- depthRw(self: VirtualPassRequest; attachment: auto const)
depthRw returns daBfg::VirtualPassRequest
argument |
argument type |
---|---|
self |
|
attachment |
auto const |
- depthRo(self: VirtualPassRequest; attachment: auto const)
depthRo returns daBfg::VirtualPassRequest
argument |
argument type |
---|---|
self |
|
attachment |
auto const |