Create an account

Shader Based 2d Scopes [1.5.1][dx10+][engine-mod] V1.3 Dltx Support  

Upload: 20 May 2022, 16:35
Created by: CrookR [X]
Uploaded by: Aqxaro
Shader Based 2d Scopes [1.5.1][dx10+][engine-mod] V1.3 Dltx Support

Improves the feeling of 2D scopes by introducing a magnification shader and some scope based effects, without the performance impact of PiP.


This is an engine mod. It will not be compatible with any other engine mod. You are also installing an .exe which means you are entrusting me to not put a bitcoin miner on your computer.

v1.2: The current version of DLTX [12th August 2021] is now built-in to the mod, thanks to MerelyMezz excellent instructions, so you should be able to let this overwrite your .exe files and your DLTX mods should continue working.

This mod is only compatible with DX10+. The solution to DX9 support is not immediately obvious to me so it may take some more time than I expected, but I am trying.

For Boomsticks and Sharpsticks compatibility - kemelvorkorp's patch is now included in the download files.

This mod attempts to improve the experience of 2D scopes by adding a simple shader that adds magnification and some effects like parallax fog and chromatic aberration. This is not PiP, it does not require the game to render the scene twice. Therefore, it does not have a severe performance impact, nor does it require you to make custom config files, textures, or modify weapon geometry. It can also darken the area outside of the scope and add blur. The mod adds a bunch of console commands that you can use to tweak the settings:

Scope Factor

The scope_factor setting changes the amount of magnification inside the scope compared to the outside. It works by just taking the existing frame and scaling it up inside the scope. Due to this, there is a tradeoff between higher magnifications and image quality. The mod will automatically adjust your weapons scope_zoom_factor to compensate, so you're not "adding" any magnification on top of the scopes magnification, just adjusting the difference in FOV outside and inside the scope.

If you don't like the effect you can set scope_factor to 1. This removes all magnification. A value of 0.75 will result in a 1.33x magnification and very little noticeable drop in quality. A value of 0.5 will result in a magnification of 2x, and 0.25 a magnification of 4x with a very noticeable drop in image quality.

Here is an image showing different settings, notice the area outside of the scope on the left image is almost entirely zoomed out but the zoom within the scope remains the same.

As a side note: If you have a beefy computer and are fond of the PiP effect, and your GPU is capable of dynamic resolution, you can render the game at a higher than native resolution to reduce the drop in quality. For example, here is a screenshot I took while rendering the game at 4x native with Nvidia DSR at a scope factor of 0.25

Notice the image on the right is much higher quality. This also has the bonus of effect of making your game look nicer.

Scope Fog

You can also change the look and feel of the parallax fog with a couple commands:

  • scope_fog_radius - How wide the scope effect is (higher values is less radius)
  • scope_fog_travel - How much the fog is allowed to block your scope
  • scope_fog_interp - How fast the scope fog clears
  • scope_fog_sharp - How blurry the edge of the fog is
  • scope_fog_swayAim - How much moving the reticle will move the fog
  • scope_fog_swayMove - How much moving the player will move the fog

Other settings

  • scope_brightness - How bright the area outside of the scope is. 0 = completely black, 1 = no dimming. Note that the vanilla scopes have their own grey texture in the area outside the scope
  • scope_ca - Intensity of chromatic aberration within the scope
  • scope_blur_outer - Intensity of blur outside of the area of the scope
  • scope_blur_inner - Intensity of the blur inside the scope. Can be useful for hiding poor image quality with lower scope_factors.

Installation

Choose either the DLTX or non-DLTX version and paste the gamedata and bin folders into your anomaly installation and allow it to overwrite the base .exe files. If you use BaS, install the BaS patch on top and let it overwrite. Ignore the source folder.

Mod compatibility

I have only tested this mod with the vanilla weapons, but it should be pretty easy making other scopes work with this mod. To do so, you need to define the scope's texture and radius in scopeRadii.script. To figure out the right radius for your scope, open the game and zoom in with it, and then use the scope_radius console command to figure out what the correct radius is. Since it's a separate script file, you can easily redistribute your modified version with your scope retextures/weapon packs.

Source

v1.3: I have now included a .diff patch file in the download files in the source folder. You can use the git "diff apply <filename.diff>" command to apply the changes to your repository of Anomaly. It does not include DLTX, but DLTX can be implemented using the same method.

Changelog

v1.1: Removed unused shader definition which may be causing crashes

v1.2: Implemented DLTX

v1.3: Implemented DX10 support and released source, and included non-DLTX version in download files

Comments
The minimum comment length is 10 characters.