Skip to content

Commit

Permalink
Several small docs updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jankrassnigg committed Jul 23, 2024
1 parent 406c1a9 commit 37b1dbe
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 21 deletions.
19 changes: 10 additions & 9 deletions pages/docs/Miscellaneous/custom-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,15 @@ The code snippet below shows what should be added to a *header file (.h)*:

<!-- BEGIN-DOCS-CODE-SNIPPET: customdata-decl -->
```cpp
class SampleCustomData : public ezCustomData
class SampleCustomData2 : public ezCustomData
{
EZ_ADD_DYNAMIC_REFLECTION(SampleCustomData, ezCustomData);
EZ_ADD_DYNAMIC_REFLECTION(SampleCustomData2, ezCustomData);

public:
ezString m_sText;
ezInt32 m_iSize = 42;
ezColor m_Color;
};

EZ_DECLARE_CUSTOM_DATA_RESOURCE(SampleCustomData);
EZ_DECLARE_CUSTOM_DATA_RESOURCE(SampleCustomData2);
```
<!-- END-DOCS-CODE-SNIPPET -->
Expand Down Expand Up @@ -110,7 +108,7 @@ Then, in the source file of your component, add the property to the component's
<!-- BEGIN-DOCS-CODE-SNIPPET: customdata-property -->
```cpp
EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData")),
EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData", "SampleCustomData")),
```
<!-- END-DOCS-CODE-SNIPPET -->

Expand All @@ -130,11 +128,14 @@ Finally, to actually access your custom data inside your game code, you have to

<!-- BEGIN-DOCS-CODE-SNIPPET: customdata-access -->
```cpp
ezResourceLock<SampleCustomDataResource> pCustomDataResource(m_hCustomData, ezResourceAcquireMode::BlockTillLoaded);
ezResourceLock<SampleCustomDataResource> pCustomDataResource(m_hCustomData, ezResourceAcquireMode::AllowLoadingFallback_NeverFail);

const SampleCustomData* pCustomData = pCustomDataResource->GetData();
if (pCustomDataResource.GetAcquireResult() == ezResourceAcquireResult::Final)
{
const SampleCustomData* pCustomData = pCustomDataResource->GetData();

ezDebugRenderer::Draw3DText(GetWorld(), ezFmt(pCustomData->m_sText), GetOwner()->GetGlobalPosition(), pCustomData->m_Color, pCustomData->m_iSize);
ezDebugRenderer::Draw3DText(GetWorld(), ezFmt(pCustomData->m_sText), GetOwner()->GetGlobalPosition(), pCustomData->m_Color, pCustomData->m_iSize);
}
```
<!-- END-DOCS-CODE-SNIPPET -->
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/ai/AiPlugin/ai-plugin-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ The plugin provides functionality to create navmeshes on-demand at runtime. See

Additionally there is C++ functionality available for searching paths and *steering* characters along the found path. See the [Monster Attack Sample](../../../samples/monster-attack/monster-attack.md), specifically the *monster component*, to see how this can be used.

# See Also
## See Also

* [Runtime Navmesh](runtime-navmesh.md)
2 changes: 1 addition & 1 deletion pages/docs/ai/AiPlugin/runtime-navmesh.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ To be able to see the navmesh, use the [CVar](../../debugging/cvars.md) `Ai.Navm
>
> No navmesh will be generated, as long as no path searches are done. Use the [navmesh path test component](navmesh-path-test-component.md) to initiate a path search.
# See Also
## See Also

* [AiPlugin Overview](ai-plugin-overview.md)
* [Navmesh Path Test Component](navmesh-path-test-component.md)
2 changes: 1 addition & 1 deletion pages/docs/custom-code/cpp/custom-cpp-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public:
private:
void Update();
float m_fAmplitude = 1.0f; // [ property ]
float m_fAmplitude = 1.0f; // [ property ]
ezAngle m_Speed = ezAngle::MakeFromDegree(90); // [ property ]
};
```
Expand Down
1 change: 1 addition & 0 deletions pages/docs/graphics/meshes/mesh-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Mesh components will cast [shadows](../lighting/dynamic-shadows.md) when the `Ca

* `Mesh`: The [mesh asset](mesh-asset.md) to render.
* `Color`: A tint color for the mesh instance. Typically this is just multiplied into the diffuse color of the mesh [materials](../../materials/materials-overview.md), though if the material uses a [visual shader (TODO)](../../materials/visual-shaders.md), the mesh color can be used to represent arbitrary input data, for example to blend between material states.
* `CustomData`: A 4-component vector to pass in arbitrary values. By default, this data is not used, at all, but custom shaders are free to use it in any way they like.
* `Materials`: By default the referenced mesh is rendered with the materials that are set up inside the mesh asset. However, the mesh component can override the materials. Each mesh has one or many *sub-meshes*, meaning mesh parts that use different materials. This array allows to set an override for each of those sub-meshes.

## See Also
Expand Down
2 changes: 1 addition & 1 deletion pages/docs/runtime/world/components.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ EZ_BEGIN_COMPONENT_TYPE(DebugRenderComponent, 2, ezComponentMode::Static)
EZ_ACCESSOR_PROPERTY("Texture", GetTextureFile, SetTextureFile)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_Texture_2D")),
EZ_BITFLAGS_MEMBER_PROPERTY("Render", DebugRenderComponentMask, m_RenderTypes)->AddAttributes(new ezDefaultValueAttribute(DebugRenderComponentMask::Box)),

EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData")),
EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData", "SampleCustomData")),
}
EZ_END_PROPERTIES;

Expand Down
8 changes: 2 additions & 6 deletions pages/docs/scenes/gizmos.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ The translate and the rotate gizmo may operate either in **local space** (*objec

### Modifiers

* Hold `ALT` while dragging a gizmo to disable snapping.
* Hold `SHIFT` while dragging a gizmo to disable snapping.

* Hold `SHIFT` before clicking a gizmo to duplicate the object in place. This works for all but the scale gizmo.

* Hold `CTRL` while translating an object to move the camera in conjunction.

All modifiers can be combined.
* Hold `CTRL` before clicking a gizmo to duplicate the object in place. This works for all but the scale gizmo.

### Gizmos in Orthographic Views

Expand Down
10 changes: 8 additions & 2 deletions pages/docs/tools/texconv.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Run TexConv.exe with the `--help` parameter to list all available options. Addit

## General Usage

TexConv always produces **exactly one output** file. It may use **multiple input** files to assemble the output from. For the assembly, it also needs a **channel mapping**, which tells it which channel (*Red, Green, Blue* or *Alpha*) to take from which input file and move it into which channel of the output image.
TexConv typically produces **one output** file. It may use **multiple input** files to assemble the output from. For the assembly, it also needs a **channel mapping**, which tells it which channel (*Red, Green, Blue* or *Alpha*) to take from which input file and move it into which channel of the output image.

The most straight forward command line is this:

Expand Down Expand Up @@ -115,6 +115,12 @@ The `-usage` option specifies the purpose of the output and thus tells TexConv w
* `-maxRes 1024` : Specifies the maximum resolution of the output. If the input image is larger, it will get downscaled.
* `-downscale 1` : If this is larger than 0, the input images will be halved in resolution N times. Use this to apply an overall quality reduction.

### Image Comparison

TexConv can also compare two images and generate difference images and an HTML page with embedded images for easy inspection.

Use `-mode Compare` to enable comparison mode, and the `-cmpXYZ` options to configure which images to compare and what outputs to generate. Console the `--help` for details.

## Examples

### Convert a Color Texture
Expand Down Expand Up @@ -151,4 +157,4 @@ TexConv.exe -out D:/alpha-mask-only.dds -in0 D:/DiffuseAlpha.dds -r in0.a

## See Also


* [Textures](../graphics/textures-overview.md)

0 comments on commit 37b1dbe

Please sign in to comment.