diff --git a/docs/content/english/Asset Management/Asset Types/shaders.md b/docs/content/english/Asset Management/Asset Types/shaders.md new file mode 100644 index 0000000..0c701b0 --- /dev/null +++ b/docs/content/english/Asset Management/Asset Types/shaders.md @@ -0,0 +1,18 @@ ++++ +title = "Shaders" +description = "" +weight = 1 ++++ + +Shaders are program snippets that run on GPU cores. They define the rendering methods. + +##### Material Shader Flags & Shader Combinations +Shaders define material flags which can is configurable per material. Every material shader flag changes a portion of the shader code to change how the material look. For example, once the "USE_PROCEDURAL_WIND_ANIMATION" flag is enabled, material will start animate in a fixed axis with respect to the wind in the scene. + +##### Shader Cache +Every material defines a new shader flag combination which in turns define a new shader code to be compiled. The game is shipped with a shader cache which contains all of the unique shader + material shader flag combinations in the base game. + +##### Bulk Shader Compilation for Mods +If a module adds a good amount of new combinations, runtime shader compilation can disrupt the flow of the game tremendously. To avoid that, the mod owner should compile the unique shader + material combinations introduced within that module. In order to do that, while the module is being published via the "Publish Module" functionality in the editor, "Compile Shaders" checkbox should be checked. The shader cache will be saved into the "Modules/'ModuleName'/Shaders/D3D11" folder. Please note that the game shaders can be changed in some version updates, even though this is not very often, for those cases the old shader cache file will be invalid and not be used. To avoid that, it would be good workflow o re-create the shader cache before every upload to a new major version of the game. Shader compilation system is highly parallel and it may finish around 30 to 60 minutes depending on the multi-core performance of the CPU. + + diff --git a/docs/content/english/Editor/Resource Editors/decals.md b/docs/content/english/Editor/Resource Editors/decals.md new file mode 100644 index 0000000..ae738cf --- /dev/null +++ b/docs/content/english/Editor/Resource Editors/decals.md @@ -0,0 +1,31 @@ ++++ +title = "Decals" + +[menu.main] +identifier = "decal" +parent = "core_components" ++++ + +## What is a Decal? + +Decals are a way of projecting materials into other geometries. They can affect the following channels of the PBR shading pipeline: Albedo, Normal, Specular, Gloss and Occlusion. Thus, changing the final appearance of other meshes and materials. They can be used to add variety to the scene like dirt, mud, moss. Also, they are a usefull tool to break texture tiles on the meshes. Their projection geometries are cubes and they are projected in the Z direction. + +## How to Setup a Decal Material? + +First of all, shader of the material should be "Decal". Diffuse, NormalMap and SpecularMap can be set to any texture. The shading model will be same as "pbr_metallic". +![](/img/decal/top_properties.png) + +#### Material Shader Flags + +Material shader flags dictates which shading properties will be used and the types of objects that the decal will be visible. Note: "use_albedo" is a must. A typical example for a decal material which will be visible on all of the materials is as follows. +![](/img/decal/material_shader_flags.png) + +#### Mandatory Settings at the 'Others' Tab + +In order for the decal to be rendered correctly, "Cull Front Faces" and the "Don't Modify Depth Buffer" flags should be enabled. +![](/img/decal/other_settings.png) + +## How to Setup a Decal Prefab? + +To create a decal entity/prefab, a specific mesh (Decal Mesh) should be added to an empty entity. Then, the material of that mesh should be chaned to the material that we prepared in the first section. Finally, under the Components/Meta Mesh/Custom Mesh Parameters, UV Scale X/Y values should be set accordingly. For a regular texture, those values should both be 1. For a atlas type texture, UV Scale and UV Offset values should be set to focus on the desired texture position inside the atlas. +![](/img/decal/entity_setup.png) diff --git a/docs/static/img/decal/entity_setup.png b/docs/static/img/decal/entity_setup.png new file mode 100644 index 0000000..81c73b0 Binary files /dev/null and b/docs/static/img/decal/entity_setup.png differ diff --git a/docs/static/img/decal/material_shader_flags.png b/docs/static/img/decal/material_shader_flags.png new file mode 100644 index 0000000..73f9f27 Binary files /dev/null and b/docs/static/img/decal/material_shader_flags.png differ diff --git a/docs/static/img/decal/other_settings.png b/docs/static/img/decal/other_settings.png new file mode 100644 index 0000000..2daf87d Binary files /dev/null and b/docs/static/img/decal/other_settings.png differ diff --git a/docs/static/img/decal/top_properties.png b/docs/static/img/decal/top_properties.png new file mode 100644 index 0000000..afc662d Binary files /dev/null and b/docs/static/img/decal/top_properties.png differ