Skip to content

Commit

Permalink
sync on 2024/11/22, rev b4ab12b2e452692a210e0707e93fd988769f3dd7
Browse files Browse the repository at this point in the history
  • Loading branch information
NicSavichev committed Nov 22, 2024
1 parent 07358a8 commit 100282d
Show file tree
Hide file tree
Showing 1,476 changed files with 9,821 additions and 376,016 deletions.
2 changes: 1 addition & 1 deletion DagorEngine.rev.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0cee6d005970bf5594bd2849bac9ed03ef6096fa
b4ab12b2e452692a210e0707e93fd988769f3dd7
13 changes: 12 additions & 1 deletion _docs/_static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

}


.wy-side-nav-search, .wy-nav-top {
background: #1a1c1e;
}
Expand All @@ -30,4 +29,16 @@ audio, canvas, video {
margin-bottom: 12px;
}

.rst-content code, .rst-content tt, code, kbd, pre, samp {
font-family: monospace,serif;
_font-family: courier new,monospace;
font-size: 0.95em;
}

.rst-content .linenodiv pre, .rst-content div[class^=highlight] pre, .rst-content pre.literal-block {
font-family: SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, Courier, monospace;
font-size: 0.95em;
line-height: 1.4;
}


81 changes: 41 additions & 40 deletions _docs/source/assets/about-assets/about_assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

## Overview

Assets refer to all types of resources used in the Dagor Engine Tools.
Assets refer to all types of resources used in the *Dagor Engine Tools*.

You can find a list of supported asset types in your project in the
[`application.blk`](../all-about-blk/application_blk.md) file. This file is a
key resource for configuring how the tools interact with your project.

```plaintext
```text
assets{
types{}
}
Expand Down Expand Up @@ -42,26 +42,28 @@ formats:
- **Legacy format**: `<asset_name>.blk`, where the asset type must be specified
within the `.blk` file.

Each assets `.blk` file contains all the parameters required by the exporter
Each asset's `.blk` file contains all the parameters required by the exporter
for that specific resource. Each type of resource has its own build tool plugin
and dedicated code in the game.

In some cases, the description within the `.blk` file is minimal. For example, a
texture asset might only require the texture name (if it's in `.dds` format). In
other cases, like effects, the entire asset is defined within the `.blk` file,
and the *AssetViewer* acts as its editor.
and the [*Asset
Viewer*](../../dagor-tools/asset-viewer/asset-viewer/asset_viewer.md) acts as
its editor.

Most assets do not have dedicated editing tools. The primary method for creating
these assets is through manual editing and hot-reloading using the tools.

However, to avoid manually creating `.blk` files for every simple asset type
(e.g., textures, skeletons, dynamic models), Dagor supports a highly flexible
(e.g., textures, skeletons, dynamic models), *Dagor* supports a highly flexible
system for creating virtual assets - through a
[`.folder.blk`](../all-about-blk/folder_blk.md) file placed within the asset
directory.

In practice, simply placing textures and models into the appropriate folders is
sufficient in 99.99% of cases. Numerous rules, such as LOD (Level of Detail)
In practice, simply placing textures and models into the appropriate directories
is sufficient in 99.99% of cases. Numerous rules, such as LOD (Level of Detail)
switching distances and texture conversion rules, will be generated
automatically.

Expand All @@ -80,7 +82,7 @@ A brief overview of texture asset parameters (all are optional, and for standard
diffuse `.dds` textures, nothing may need to be specified. For `.tga` files, two
parameters are typically required: `convert:b=yes`, `fmt:="DXT1|DXT5"`):

```plaintext
```text
contents{
convert:b=yes; fmt:t="DXT1|DXT5"
mipmapType:t=mipmapGenerate
Expand All @@ -102,25 +104,24 @@ contents{
}
```

- **`convert`**: Converts the texture (mandatory for all `.tga` or `.psd`
textures).
- **`fmt:t`**: Specifies the format to convert to (options include `DXT1`,
`DXT5`, `ARGB`, `L8`, `A8L8`, `L16`).
- **`mipmapType:t`**: Method for generating mipmaps (`mipmapGenerate`,
- `convert`: Converts the texture (mandatory for all `.tga` or `.psd` textures).
- `fmt:t`: Specifies the format to convert to (options include `DXT1`, `DXT5`,
`ARGB`, `L8`, `A8L8`, `L16`).
- `mipmapType:t`: Method for generating mipmaps (`mipmapGenerate`,
`mipmapUseExisting`, `mipmapNone`).
- **`mipFilter`**: Specifies the filter used to generate mipmaps
(`filterKaiser`, `filterBox`, `filterCubic`).
- **`hqMip`**, **`mqMip`**, **`lqMip`**: Specifies which mip level to use at
high, medium, and low quality settings.
- **`swizzleARGB`**: Specifies how to swizzle the texture channels. Typically
not needed.
- **`gamma`**: Gamma correction value (1 for normal maps and masks, default is
- `mipFilter`: Specifies the filter used to generate mipmaps (`filterKaiser`,
`filterBox`, `filterCubic`).
- `hqMip`, `mqMip`, `lqMip`: Specifies which mip level to use at high, medium,
and low quality settings.
- `swizzleARGB`: Specifies how to swizzle the texture channels. Typically not
needed.
- `gamma`: Gamma correction value (`1` for normal maps and masks, default is
`2.2`).
- **`addrU`**, **`addrV`**: Texture addressing mode (`wrap`, `clamp`, `border`).
- `addrU`, `addrV`: Texture addressing mode (`wrap`, `clamp`, `border`).

### Dynamic Models and Rendering Instances

```plaintext
```text
lod{
range:r=70; fname:t="$1.lod00.dag";
}
Expand All @@ -138,13 +139,14 @@ texref_prefix:t="low_"
all_animated:b=yes
```

- **`lod`**: LOD parameters.
- **`range:r`**: LOD distance.
- **`fname:t`**: Optional filename, defaults to `$1.lod<lod_number>.dag`.
- **`texref_prefix:t`**: Prefix added to all texture references in the model.
- **`ref_skeleton:t`**: Reference skeleton for dynamic models, necessary for
correct preview in *AssetViewer*.
- **`all_animated:b`**: Indicates that all objects in the model should be
- `lod`: LOD parameters.
- `range:r`: LOD distance.
- `fname:t`: Optional filename, defaults to `$1.lod<lod_number>.dag`.
- `texref_prefix:t`: Prefix added to all texture references in the model.
- `ref_skeleton:t`: Reference skeleton for dynamic models, necessary for correct
preview in [*Asset
Viewer*](../../dagor-tools/asset-viewer/asset-viewer/asset_viewer.md).
- `all_animated:b`: Indicates that all objects in the model should be
considered animated, i.e., having their own matrices.

### Composite Dynamic Models
Expand All @@ -156,7 +158,7 @@ Below are the rules for creating a
[`.skeleton.blk`](../all-about-blk/skeleton_blk.md) file for a composite model,
using a tank with several turret and gun options as an example:

```plaintext
```text
name:t="tank_body.lod00.dag"
attachSubSkel{
attach_to:t="bone_turret"
Expand Down Expand Up @@ -188,13 +190,13 @@ attachSubSkel{
}
```

- **name:t**: Parent model name.
- **attachSubSkel{}**: Block for adding a dynamic model.
- **attach_to:t**: Node in the parent skeleton to which the additional dynamic
- `name:t`: Parent model name.
- `attachSubSkel{}`: Block for adding a dynamic model.
- `attach_to:t`: Node in the parent skeleton to which the additional dynamic
model is linked.
- **skel_file:t**: Child model file name.
- **skel_node:t**: Node in the child models skeleton to link with the parent.
- **add_prefix:t**: Prefix for all child model nodes.
- `skel_file:t`: Child model file name.
- `skel_node:t`: Node in the child model's skeleton to link with the parent.
- `add_prefix:t`: Prefix for all child model nodes.

In the `.skeleton.blk` file above, the skeleton generated from the `tank_body`
model is extended with the turrets `turret_a` and `turret_b`, which are attached
Expand All @@ -212,9 +214,8 @@ the hierarchy, received prefixes `G1` and `G2`. Similarly, the nodes in
- When specifying the attachment node, do not include automatically added
prefixes.
- If a child model is attached to a node with the same name as one of its
bones, the previous node is removed from the hierarchy. There won’t be a
duplicate – don’t worry.
bones, the previous node is removed from the hierarchy. There won't be a
duplicate – don't worry.
```

While theoretically, you can create a very deep hierarchy of dependencies,
Expand All @@ -223,7 +224,7 @@ new levels before doing that.

A multi-level hierarchy might look like this:

```plaintext
```text
name:t="papa.lod00.dag"
attachSubSkel{
attach_to:t="bone_papa"
Expand Down
Loading

0 comments on commit 100282d

Please sign in to comment.