- Category: Materials
- Update: 1.2 (10-10-2019)
- Unreal Engine: 4.18 - 4.23
- Platforms: PC, Console, HTML
Weapon FOV is an advanced and very useful material node that solves a lot of issues related to the first-person character. This package will take your FPP game to industry standards like Shadow Warrior, HL2, Battlefield, Dying Light, and much more without any noticeable additional cost.
It is just one node in material calculated per-vertex so implementation is very fast and you don’t need to use any additional render target or separate pass to fix problems with a weapon.
Unreal Marketplace :
- Separate weapon FOV – You can set a custom field of view per weapon. Fixes the weapon stretching when changing the game FOV. Useful for calibrating weapon size on the screen independently to the camera.
- Weapon depth priority – Weapon scale in camera Z-axis (depth). This feature fixes the intersection of weapons with walls. Player capsule radius can be smaller and the weapons can be rendered over the environment.
- Near plane clipping – Modify the near clip plane to see more/less of mesh in the camera.
- Weapon transform – Applies a custom position of the weapon in camera space.
- Effect blending – Implements the transition between FOV space and world space. Useful for projectiles and character body that is standing on the ground.
- Material node – Can be customized per weapon or controlled in global material parameter collection.
- Clean implementation – Calculated per-vertex, very fast no need to use the separate pass to fix problems with a weapon.
- Zooming effect – Change the camera FOV when the weapon stays the same. That makes scope zoom effect really easy to implement.
- NEW! Realistic sniper scope – Multiple parameters: lens refraction, aberration, overlays ect.
- Open material that should be rendered in special weapon FOV mode.
- Go to detail panel on the left-hand side ( Default Viewport on 4.23 )
Check ” Materials > Use Material attributes [ Bool Value ] “ to true.
- Create a new node ” MakeMaterialAttributes “ and plug everything the same as how your materials work.
- Create a new materials function node ” ML_WeaponFOV “ plug into ” Material Attributes “.
- or in case you have “ Use Material attributes = False ”in the material then put” MF_WeaponFOV “ material node before the final node in the chain.
- And here is an example of materials.
All global parameters can be edit by ( MP_WeaponFOV [ Material Parameter Collection ] ) inside of Weapon FOV folder.
|Weapon FOV||Custom field of view per weapon. This fixes the weapon stretching when changing the game FOV. Useful for implementing zoom effect and calibrating weapon size in the screen independently to the camera.|
|Depth Scale||Weapon scale in camera Z-axis (depth). This feature fixes the intersection of weapons with walls. Player capsule radius can be smaller and the weapons can be rendered over the environment.|
|ClipDistance||Modify near clip plane to see more/less of mesh in the camera.|
|Blend Effect||Bending between enabled(1.0) and disabled(0.0) effect.|
|Weapon Offset||Transformation of the weapon the camera space.|
Custom field of view for the mesh that applied with materials, This fixes the weapon stretching when the field of view of the game camera has been changed to other values, Useful for implementing zoom effect and calibrating weapon size in the screen independently to the camera.
Modify near clip plane to see more/less of mesh in the camera, This function is working same as (Near clip plane) features in Unreal Engine 4.
Weapon scale in camera Z-axis (depth). This feature prevents the intersection of weapons with walls. The Player capsule radius can be really small and the weapons will be still rendered over the geometry of the scene.
Implements transition between FOV space and world space based on the distance from the camera. Useful for projectiles and character body that is standing on the ground.
The WeaponFOV package in version 1.2 introduces a new feature that helps to implement sniper scope in your games.
Basically the scope implementation is base on rendering the scene to texture form second zoom camera installed inside the scope so it can be little heavy and should be used wisely
New advanced material M_ScopeLens can be found in the Utils folder.
Example instanced material of M_ScopeLens can be found Demo folder WeaponFov/Demo/Weapon/MI_ScopeLens. Multiple parterres can be modified to achieve a very realistic effect of scope all visual effects are divided into three categories Lens Layer, Overlay Layer, Circle Mask:
The black circle represents the mask of effect.
|Circle Radius||The radios of the circle mask.|
|Circle Width||Width of circle mask edge.|
|Circle Color||Color outside of the circle mask.|
|Use Circle Mask||Whether the circle mask should be used.|
Distortion used on texture rendered from the additional camera.
|Lens||Aberration of R/G/B channel and exponential power of effect in encoded in the Alpha channel. (UseLensAberration=true)|
|Lens Color||A color multiplier of the lens texture.|
|Lens Map||Render target of the scene.|
|Lens Refraction||Lens refraction effect scale (fisheye). (UseLensRefraction = true)|
|Specular Offset||The base secular of the lens (lens reflection)|
|Specular Scale||The secular scale of the lens out of the screen center. (lens reflection)|
The texture layer renders the telescopic sight.
|Overlay Alpha Source||The source channel of overlay alpha.|
|Overlay Color||The color multiplier of the overlay mask.|
|Overlay Depth Offset||Depth offset of the overlay texture.|
|Overlay position Scale UV||RG-Position, BA-Scale of overlay texture.|
|Overlay Texture||The texture used as an overlay map.|
|Use Overlay Texture||Whether use the overlay map.|
Advanced Mesh UV
Mesh UV is a group of advanced parameters that can be used for adjusting the UV mapping of the scope projection on the screen.
|Depth Offset||Offset scale when the circle is not centered on the screen. Use 0 for no offset.|
|Depth Scale||Scale the circle when the circle is not centered on the screen. Use 0 for no scale.|
|Pivot Direction||Pivot direction of the scope relative to the weapon. It helps to calculate the projection of the camera texture on the screen.|
|Pivot Pivot Offset||Pivot location of the scope relative to the weapon. It helps to calculate the projection of the camera texture on the screen.|
Use Component Space Pivot
|Whether the circle mask should be calculated in the pivot space.|
Questions & Answers
Weapon is disappearing. Why?
The engine detects that weapon is hidden behind the wall/hand and decides that it should not be rendered. To fix this you will have to increase bounding box size, you can do it in your weapon mesh asset or mesh component (bounds scale).