Skip to content

Commit

Permalink
Pass all the documentation through Grammarly to check for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sercero authored and paroj committed Feb 17, 2023
1 parent a319ece commit 6f73e4e
Show file tree
Hide file tree
Showing 9 changed files with 120 additions and 125 deletions.
25 changes: 12 additions & 13 deletions CustomSplitNormals.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

# Custom Split Normals

Custom Split Normals is a way to tweak the mesh shading by pointing normals towards directions other than the default, auto-computed ones.
It is mostly used in game development, where it helps counterbalance some issues generated by low-poly objects
(the most common examples are low-poly trees, bushes, grass, etc. and the ‘rounded’ corners).
Expand All @@ -10,19 +9,19 @@ It is mostly used in game development, where it helps counterbalance some issues

The first step towards working with Custom Normals is having Blender show them.

Select the object you are working with, enter `Edit Mode` and in the upper right corner there is an `Overlays` menu.
Select the object you are working with, enter `Edit Mode`, and in the upper right corner, there is an `Overlays` menu.
In the `Overlays` menu we have the option of displaying "Vertex Normals", "Split Normals" and "Face Normals"

![Showing the Normals of the default Cube](images/normals/show-custom-split-normals.png)

In this example we are showing both "Vertex Normals" (colored blue) and "Split Normals" (colored pink)
In this example, we are showing both "Vertex Normals" (colored blue) and "Split Normals" (colored pink)

## Custom Normals
[Blender Normal Editing TOOLS (In 2 Minutes!!)](https://www.youtube.com/watch?v=hwhM437Xvks)

Custom Normals refers to the feature of being able to modify the vertex normals as one sees fit.
Custom Normals refer to the feature of being able to modify the vertex normals as one sees fit.
This can be useful for example in anime characters that usually need specific shading profiles to look good with the toon shader.
One way to accomplish that is editing the normals of the Mesh.
One way to accomplish that is by editing the normals of the Mesh.

There are many ways to edit the Normals, one option is to use modifiers and another is to edit the normals directly.

Expand All @@ -32,19 +31,19 @@ Please consult the video and documentation to know more about editing normals in

## Sharp Edges
One of the uses for Custom Normals is to have hard edges on an otherwise smooth mesh.
This allows for a simpler geometry, due to the fact that a smooth mesh gets exported to fewer vertices.
(That is because to have flat shading in OGRE, there has to be as many vertices as normals)
This allows for a simpler geometry since a smooth mesh gets exported to fewer vertices.
(That is because to have flat shading in OGRE, there have to be as many vertices as normals)

![Smooth vs Flat shading](images/normals/smooth-vs-flat-shading.png)

In the Smooth vs Flat shading world there is a third option in Blender: Auto Smooth, or Smooth with hard edges
In the Smooth vs Flat shading world, there is a third option in Blender: Auto Smooth, or Smooth with hard edges

![Smooth vs Flat vs Auto Smooth shading](images/normals/flat-vs-smooth-vs-auto-smooth.png)

Thanks to the Auto Smooth feature, it is possible to have hard eged but also smooth ones in the same mesh.
(This example mesh was made by adding a `Boolean` modifier to the Cube and then performing an Union operation with the Cylinder)
Thanks to the Auto Smooth feature, it is possible to have hard edges but also smooth ones in the same mesh.
(This example mesh was made by adding a `Boolean` modifier to the Cube and then performing a Union operation with the Cylinder)

In order to acomplish this kind of shading, select the Object and make sure you are in `Object Mode`.
To accomplish this kind of shading, select the Object and make sure you are in `Object Mode`.
Then set the Object shading to "Shade Smooth" (Object -> Shade Smooth (Blender 2.8+))

![Auto Smooth and Split Normals menu](images/normals/auto-smooth-and-split-normals.png)
Expand All @@ -57,7 +56,7 @@ With this operation, Blender automatically marks the Sharp Edges in the mesh and

If you need to mark other Edges as sharp, because the "Auto Smooth" is insufficient then it is possible to mark more Edges as sharp.

Make sure you are in `Edit Mode` and `Edge Selection Mode`, select the Edges you want to mark as sharp and then select the option `Edge->Mark Sharp`
Make sure you are in `Edit Mode` and `Edge Selection Mode`, select the Edges you want to mark as sharp, and then select the option `Edge->Mark Sharp`

![Showing Sharp Edges](images/normals/sharp-edges-marked.png)

Expand All @@ -79,5 +78,5 @@ The option `Clamp Overlap` should be disabled in some cases where the geometry o

For the `Weighted Normal` modifier to work well, you have to enable "Auto Smooth": (▽ -> Normals -> Auto Smooth)

> NOTE: Until this is fixed, in order for the Fillet Edges to look correct in the exported Mesh you have to create a copy of the object, apply the modifiers then go into `Edit Mode` and perform a manual triangulation of the Mesh (Face -> Triangulate Faces or Ctrl-T)
> NOTE: Until this is fixed, for the Fillet Edges to look correct in the exported Mesh you have to create a copy of the object, apply the modifiers then go into `Edit Mode` and perform a manual triangulation of the Mesh (Face -> Triangulate Faces or Ctrl-T)
12 changes: 6 additions & 6 deletions MeshTriangulation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

# Mesh Triangulation

While Blender is able to create meshes featuring triangles, quads and n-gons, OGRE3D being a realtime rendering engine deals only with triangles.
While Blender can create meshes featuring triangles, quads and n-gons, OGRE3D being a realtime rendering engine deals only with triangles.
That means that blender2ogre needs to perform a process of mesh triangulation to export the meshes.
Sometimes this triangulation process leads to some problems described here.

Expand All @@ -16,7 +16,7 @@ Sometimes this triangulation process leads to some problems described here.
## Non-coplanar Faces
The first problem happens when during the process of creating a mesh an artist ends up with faces that are not coplanar.
This means that the vertices of the face are not all on the same plane.
For a triangle the vertices are always on the same plane, but for quads and n-gons that is not necesarily true.
For a triangle, the vertices are always on the same plane, but for quads and n-gons that is not necessarily true.

When a mesh has non-coplanar faces, the resulting triangulated mesh looks different than the original.

Expand All @@ -28,7 +28,7 @@ Suzanne without triangulation | Suzanne with `Triangulate` modifier

Blender has tools to detect this type of problems in the mesh analysis section of the Viewport Overlays.

Select the object, then go into `Edit Mode` and in the upper right corner there is an `Overlays` menu.
Select the object, then go into `Edit Mode` and in the upper right corner, there is an `Overlays` menu.

![Viewport Overlays](images/triangulate/viewport-overlays.png)

Expand Down Expand Up @@ -71,7 +71,7 @@ The fix is to avoid using non-coplanar faces or trying to fix them when they app
## Custom Normals
Bugs reported to https://developer.blender.org
- [Triangulate modifier breaks custom normals](https://developer.blender.org/T61942)
- [Triangulate faces sometimes produces degenerate triangle faces](https://developer.blender.org/T103913)
- [Triangulate faces sometimes produce degenerate triangle faces](https://developer.blender.org/T103913)
- [Triangulate non-planar faces with "beauty" method produces faces that point in different directions](https://developer.blender.org/T85402)
- [Shading is broken with Custom Normals + Triangulate Modifier](https://developer.blender.org/T104244)

Expand All @@ -81,11 +81,11 @@ So be careful when using Custom Normals (that is modifying normas by using some

One way to check if the exported object will look good is to add `Triangulate` modifier with quad method `Fixed`, if the shading looks wrong compared to removing the modifier then it will look wrong in OGRE as well since the exporter is using Blenders triangulation code to perform the calculations.

For example, this cube has had a `Bevel` modifer and a `Weighted Normals` modifier applied, then we add a `Triangulate` modifier and the result is that there are visible triangles in the shading of the cube.
For example, this cube has had a `Bevel` modifier and a `Weighted Normals` modifier applied, then we add a `Triangulate` modifier and the result is that there are visible triangles in the shading of the cube.

Cube without triangulation | Cube with triangulation
:-------------------------:|:-------------------------:
![Cube without triangulation](images/triangulate/beveled-cube.png) | ![Cube with triangulation](images/triangulate/beveled-broken-cube.png)

> NOTE: Until this is fixed, in order for the Fillet Edges to look correct in the exported Mesh you have to create a copy of the object, apply the modifiers then go into `Edit Mode` and perform a manual triangulation of the Mesh (Face -> Triangulate Faces or Ctrl-T)
> NOTE: Until this is fixed, for the Fillet Edges to look correct in the exported Mesh you have to create a copy of the object, apply the modifiers then go into `Edit Mode` and perform a manual triangulation of the Mesh (Face -> Triangulate Faces or Ctrl-T)
21 changes: 10 additions & 11 deletions Modifiers.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ With modifiers, you can perform many effects automatically that would otherwise
(such as subdivision surfaces) and without affecting the base geometry of your object.

`blender2ogre` supports exporting meshes with modifiers, but not all modifiers are supported.
Also some modifiers have special treament (Array and Armature), please check the corresponding sections
Also, some modifiers have special treatment (Array and Armature), please check the corresponding sections

> NOTE: Support for modifiers is *best effort*, in most cases the modifiers habe been tested individually and not all combinations have been tried.
> NOTE: Support for modifiers is *best effort*, in most cases the modifiers have been tested individually and not all combinations have been tried.
> **WARNING**: Beware of using Modifiers that increase the vertex o poly count of the models when exporting (like Subdivision Surface) since the exported mesh might not be very optimal for realtime rendering. Retopology is adviced in these cases to improve render times.
> **WARNING**: Beware of using Modifiers that increase the vertex o poly count of the models when exporting (like Subdivision Surface) since the exported mesh might not be very optimal for realtime rendering. Retopology is advised in these cases to improve render times.
## Index
- [Documentation](#documentation)
Expand Down Expand Up @@ -48,9 +48,9 @@ Modifier | Supported | Notes
[Geometry Nodes](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/geometry_nodes.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK with the proper geometry
[Mask](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/mask.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK with applied mask
[Mirror](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/mirror.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK with applied mirroring
[Multiresolution](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/multiresolution.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK, the `Level Viewport` parameter should be more than 0, otherwise the base mesh will be exported. Also this potentially exports an insane amount of geometry, you might want to do a retopology and use normal maps to bake the details.
[Multiresolution](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/multiresolution.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK, the `Level Viewport` parameter should be more than 0, otherwise the base mesh will be exported. Also, this potentially exports an insane amount of geometry, you might want to do a retopology and use normal maps to bake the details.
[Remesh](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/remesh.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but UV Maps are removed from the Mesh
[Screw](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/screw.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but base object has to be a mesh otherwise nothing is exported
[Screw](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/screw.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but the base object has to be a mesh otherwise nothing is exported
[Skin](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/skin.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but UV Maps are removed from the Mesh
[Solidify](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/solidify.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK with thickness added
[Subdivision Surface](https://docs.blender.org/manual/en/latest/modeling/modifiers/generate/subdivision_surface.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK, as with the `Multiresolution Modifier` beware of the vertex count of the exported mesh (which affects performance).
Expand All @@ -77,7 +77,7 @@ Modifier | Supported | Notes
[Surface Deform](https://docs.blender.org/manual/en/latest/modeling/modifiers/deform/surface_deform.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK
[Volume Displace](https://docs.blender.org/manual/en/latest/modeling/modifiers/deform/volume_displace.html) | ![Not Supported](images/modifiers/fail.png) | Only works on volumes, not meshes
[Warp](https://docs.blender.org/manual/en/latest/modeling/modifiers/deform/warp.html) | ![Supported](images/modifiers/ok.png) | Mesh exports OK
[Wave](https://docs.blender.org/manual/en/latest/modeling/modifiers/deform/wave.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but only the first frame there is no motion. In order to bake the animation, consult [xxx]
[Wave](https://docs.blender.org/manual/en/latest/modeling/modifiers/deform/wave.html) | ![Supported*](images/modifiers/warning.png) | Mesh exports OK, but only in the first frame there is no motion. To bake the animation, consult [xxx]

## Array Modifier
This modifier as well as the `Armature Modifier` get their special section because they are treated differently by `blender2ogre`.
Expand All @@ -88,9 +88,9 @@ However the case of the `Array Modifier` is different, since the presence of thi
What happens is that in `scene.py` (which creates the .scene output) the `Array Modifier` is used to place instances of the mesh in positions indicated by the modifier.
This means that the exported mesh appearance is not modified by the `Array Modifier`, but only its placement in the scene.

As a result there is only one copy of the mesh in the scene that is repeated many times, which could lead to a performance increase if using instancing.
As a result, there is only one copy of the mesh in the scene that is repeated many times, which could lead to a performance increase if using instancing.

> NOTE: To disable this behaviour and have the `Array Modifier` be applied to the mesh directly, then set the option: `ARRAY` to true in the mesh options
> NOTE: To disable this behavior and have the `Array Modifier` be applied to the mesh directly, then set the option: `ARRAY` to true in the mesh options
## Boolean Modifier
This modifier works well and is in principle fully supported, but you might get this error when exporting meshes with the `Boolean Modifier`:
Expand All @@ -100,7 +100,6 @@ FAILED to assign material to face - you might be using a Boolean Modifier betwee

The issue here is that `blender2ogre` has a problem when the two objects that make contact to perform the boolean operation don't have the same material assigned to the faces which enter into contact.

To solve this you need to assign the same material to the faces wich are in contact, this might be as simple as assigning a Material to the whole secondary object or having to do something more complex like assigning the same material to the faces that come into contact by entering `Edit Mode` and assigning the material by hand to each face.

As a last resort it is also possible to make a copy by hand of the object, apply the `Boolean Modifier` and export that mesh.
To solve this you need to assign the same material to the faces which are in contact, this might be as simple as assigning a Material to the whole secondary object or having to do something more complex like assigning the same material to the faces that come into contact by entering `Edit Mode` and assigning the material by hand to each face.

As a last resort, it is also possible to make a copy by hand of the object by applying the `Boolean Modifier` and exporting that mesh.
Loading

0 comments on commit 6f73e4e

Please sign in to comment.