Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
"paintable",
"Paks",
"Panakotta",
"Panini",
"passaround",
"Photoshop",
"Quixel",
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
*** xref:Development/Modeling/setup.adoc[Workflow Setup]
*** xref:Development/Modeling/MainMaterials.adoc[Main Materials]
*** xref:Development/Modeling/style.adoc[Style Guide]
*** xref:Development/Modeling/PaniniProjection.adoc[Panini Projection]
** xref:Development/UnrealEngine/index.adoc[Unreal Engine]
*** xref:Development/UnrealEngine/UnrealLearningResources.adoc[Unreal Learning Resources]
*** xref:Development/UnrealEngine/CoreRedirect.adoc[Core Redirects]
Expand Down
98 changes: 98 additions & 0 deletions modules/ROOT/pages/Development/Modeling/PaniniProjection.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
= First Person Rendering with Panini Projection

Satisfactory's rendering pipeline utilizes a post processing effect to render the pioneer's arms and equipment correctly.
Applying this same effect to your modded first person materials (equipment, trinkets, player models) is essential
to ensure they line up correctly with the player model as end user Field Of View (FOV) settings vary.
The effect should not be applied modded building and item materials because the game's existing world rendering pipeline already handles it.

The most convenient ways to apply the effect to your mod's content are:

- Making a material instance from a base-game material that already has supports it
- Using the relevant material node in your own materials

== Behind the Scenes

In Satisfactory, first-person equipment is drawn in a separate render pass
to ensure the pioneer's arms and tools don't clip into the environment when you get really close to things.

To limit visual distortions when the user is playing with a large FOV,
a post-processing effect called a **Panini Projection** is applied to the world and the player's first person models.
To learn more, see
https://dev.epicgames.com/documentation/en-us/unreal-engine/panini-projection-in-unreal-engine?application_version=5.3[the Unreal Engine documentation and its linked resources].

The projection's implementation looks the best with an FOV of 90°,
so Satisfactory always renders the player's first person viewmodels with a fixed 90° FOV.
Note that in game option "First Person FOV Modifier" adjusts the model's scale, not its FOV.

== In-Game Appearance

You can tell a material is not set up properly if its position changes noticeably
when the user adjusts their FOV.

The below screenshots showcase the appearance of ExampleMod's example trinket at different "Field of View" game option values.
The left side has the projection enabled, while the right side has it disabled.

Note that the model does not connect correctly when the projection is disabled at FOVs other than 90°.

[cols="a,a"]
|===
|✔️ Panini Enabled |❌ Panini Disabled

| image::Development/3DModeling/Panini/Correct_70.png[title=Enabled (70° FOV)]
| image::Development/3DModeling/Panini/Incorrect_70.png[title=Disabled (70° FOV)]

| image::Development/3DModeling/Panini/Correct_90.png[title=Enabled (90° FOV)]
| image::Development/3DModeling/Panini/Incorrect_90.png[title=Disabled (90° FOV)]

| image::Development/3DModeling/Panini/Correct_120.png[title=Enabled (120° FOV)]
| image::Development/3DModeling/Panini/Incorrect_120.png[title=Disabled (120° FOV)]

| image::Development/3DModeling/Panini/Panini_on.png[title=Modded equipment Enabled (90° FOV)]
| image::Development/3DModeling/Panini/Panini_off.png[title=Modded equipment Disabled (90° FOV)]

|===

== Reusing Base Game Materials

A number of base game materials already have Panini Projection support built in.
You can create material instances from them to easily enable the effect on your modded content
assuming the materials' other behaviors suit your needs.
It can be enabled via their material parameters, usually called something like "UsePaniniProjection".
This is the approach taken by Example Mod's Example Trinket, Desc_Trinket_TvOfKnowledge.

Examples of base game materials that support Panini Projection include equipment and trinket materials, as well as MM_FactoryBaked.
For example, trinkets can use the `Asset_Master` material with the "UsePaniniProjection" option enabled.

== Enabling Panini Projection on Custom Materials

Panini can be integrated into custom materials in two main ways, depending on whether your material uses Material Attributes.

[id="MF_ApplyPaniniProjection"]
=== 1. Using `MF_ApplyPaniniProjection` (Material Attributes workflow)

. In your Material settings, enable *Use Material Attributes*.
. Use `MakeMaterialAttributes` to gather outputs.
. Add a new `MF_ApplyPaniniProjection` node to the material graph.
. Feed the result into Apply Panini Projection.
. Add a `Static Switch` to toggle Panini on/off.
. Connect the Panini Projection node to the *Static Switch True* input.
. Connect the result of Make Material Attributes to the *Static Switch False* input.
. Connect the result to the Material's *Material Attributes* output.

Use Material Instances to enable toggling the effect per-instance without recompiling the shader.
This is particularly useful because the models of other players, and 3rd person view models) should not have the effect applied.

image::Development/3DModeling/Panini/Apply_Panini.png[Apply Panini, title=Apply Panini]

[id="MF_PaniniProjection"]
=== 2. Using `Panini Projection` directly (non-attributes workflow)

. Add a new `MF_PaniniProjection` node to the material graph.
. Connect the parameters: *d* (distance), *s* (squeeze), *Screen Space Scale*, and *WPO*.
. Add a `Static Switch` to toggle Panini on/off.
. Feed the result of the Panini Projection into the *Static Switch True* input.
. Plug a `Texture Coordinate` Node into the *Static Switch False* input.
. Plug the result into the respective `Texture Sample` *UV* input.
. Route the output to your material logic (e.g., Emissive/Color/Roughness, CustomUV).

image::Development/3DModeling/Panini/Direct_Panini.png[Direct Panini, title=Direct Panini]