Natural Selection 2

Natural Selection 2

Not enough ratings
Alien Vision Changes for 325
By Samoose
https://steamhost.cn/steamcommunity_com/sharedfiles/filedetails/?id=122760829 see this guide for how to setup modifications for Alien Visions
This guide details the changes made in 325 for Alien Vision
Entities are now able to be distinguished individually.
The new changes are as follows:
   
Award
Favorite
Favorited
Unfavorite
BaseModelMixin Changes
* Marines Players are now set to a depth.g of 1
* Marine Structures have a depth.g of 0.98
* Alien Players are 0.96 (excluding Gorges and Babblers)
* Gorges are now 0.94
* All other entities (Alien Structures) now have a depth.g of 0.90
These changes can be found in core/lua/Mixins/BaseModelMixin.lua
What this file does is specifies the depth.g of the different entities, as well as adds a functions BaseModelMixin:GetIsHighlightEnabled()
This function allows you to do modifications such as the following
RifleHooked.lua function Rifle:GetIsHighlightEnabled() return 0.88 end
The above code can used with the file hooks system to allow for client side modifications of Alien Vision.
DarkVision.hlsl Changes
if ( depth1.g > 0.99 ) // marines 1 { return lerp(inputPixel, edgeColorOrange * edge, (0.45 + edge) * amount); } else if ( depth1.g > 0.96 ) // marine structures 0.98 { return saturate( inputPixel + edgeColorDarkBlue * 0.075 * amount * edge ); } else if ( depth1.g > 0.94 ) // alien players 0.96 { float4 edgeColor=edgeColorGreen*clamp((fadeout*5),0.05, 0.02); return lerp(inputPixel, max(inputPixel*baseColor,edge*edgeColor), 0.4); } else if ( depth1.g > 0.92 ) // gorges 0.94 { return saturate( inputPixel + edgeColorGreen * 0.035 * amount * edge ); } else { // targets and world ents 0.9 return saturate( inputPixel + edgeColorGreen * 0.1 * amount * edge ); }

For any custom additions you make with GetIsHighlightEnabled(), you add a case in DarkVision in the series of if statements above. For example, if we wanted to add a custom case for the rifle, we could do the below code
else if ( depth1.g > 0.87 ) // rifle 0.88 { return saturate( inputPixel + edgeColorPurple * 0.035 * amount * edge ); }