diff --git a/pages/docs/Miscellaneous/custom-data.md b/pages/docs/Miscellaneous/custom-data.md index 51b94ca..74f77bd 100644 --- a/pages/docs/Miscellaneous/custom-data.md +++ b/pages/docs/Miscellaneous/custom-data.md @@ -20,17 +20,15 @@ The code snippet below shows what should be added to a *header file (.h)*: ```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); ``` @@ -110,7 +108,7 @@ Then, in the source file of your component, add the property to the component's ```cpp -EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData")), +EZ_ACCESSOR_PROPERTY("CustomData", GetSampleCustomDataResource, SetSampleCustomDataResource)->AddAttributes(new ezAssetBrowserAttribute("CompatibleAsset_CustomData", "SampleCustomData")), ``` @@ -130,11 +128,14 @@ Finally, to actually access your custom data inside your game code, you have to ```cpp -ezResourceLock pCustomDataResource(m_hCustomData, ezResourceAcquireMode::BlockTillLoaded); +ezResourceLock 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); +} ``` diff --git a/pages/docs/ai/AiPlugin/ai-plugin-overview.md b/pages/docs/ai/AiPlugin/ai-plugin-overview.md index 49a31f6..3f21b13 100644 --- a/pages/docs/ai/AiPlugin/ai-plugin-overview.md +++ b/pages/docs/ai/AiPlugin/ai-plugin-overview.md @@ -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) diff --git a/pages/docs/ai/AiPlugin/runtime-navmesh.md b/pages/docs/ai/AiPlugin/runtime-navmesh.md index 0112bb0..73ffbac 100644 --- a/pages/docs/ai/AiPlugin/runtime-navmesh.md +++ b/pages/docs/ai/AiPlugin/runtime-navmesh.md @@ -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) diff --git a/pages/docs/custom-code/cpp/custom-cpp-component.md b/pages/docs/custom-code/cpp/custom-cpp-component.md index 5a2d5ee..5aff491 100644 --- a/pages/docs/custom-code/cpp/custom-cpp-component.md +++ b/pages/docs/custom-code/cpp/custom-cpp-component.md @@ -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 ] }; ``` diff --git a/pages/docs/graphics/meshes/mesh-component.md b/pages/docs/graphics/meshes/mesh-component.md index 402d66c..1e012a4 100644 --- a/pages/docs/graphics/meshes/mesh-component.md +++ b/pages/docs/graphics/meshes/mesh-component.md @@ -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 diff --git a/pages/docs/runtime/world/components.md b/pages/docs/runtime/world/components.md index bec6d0f..4cf0d5c 100644 --- a/pages/docs/runtime/world/components.md +++ b/pages/docs/runtime/world/components.md @@ -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; diff --git a/pages/docs/scenes/gizmos.md b/pages/docs/scenes/gizmos.md index 9ab3a2c..4c5356e 100644 --- a/pages/docs/scenes/gizmos.md +++ b/pages/docs/scenes/gizmos.md @@ -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 diff --git a/pages/docs/tools/texconv.md b/pages/docs/tools/texconv.md index 9e121dd..263e1b7 100644 --- a/pages/docs/tools/texconv.md +++ b/pages/docs/tools/texconv.md @@ -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: @@ -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 @@ -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)