Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thermals V3 #776

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AdamTadeusz
Copy link
Contributor

Description

-------> SHADERS AND NEW MATERIALS IN NeotokyoRebuild/neoAssets#15 <-------

Added noise to the thermals;

Reduced initial thermal shader colour gradient offset to make dark objects stand out a bit more (using black screen with default colour of 0 0 0 to work out what I believe is the correct value) and added a multiplier to compensate for bright areas not being as bright with the offset reduction;

View models and other models now use the tvmgrad and tvmgrad2 textures respectively to colour correct. This methodology can probably be used in the night vision and especially the motion vision to get a more original colour and also make those shaders more performant and less complicated (see materials/dev/nvgrad.vtf and materials/dev/mvgrad.vtf);

The way the gradients are passed from the material to the shader can also probably be used to remove the janky way that thermoptic cloak's strength is passed to the thermoptic shader, instead of through the current modification of a convar everytime a cloaked object is drawn

Toolchain

  • Windows MSVC VS2022
  • Linux GCC Distro Native [Specify distro + GCC version]
  • Linux GCC 10 Sniper 3.0

Linked Issues

@AdamTadeusz AdamTadeusz added the Changes in neoAssets This PR depends on changes in the neoAssets repository. The relevant PR should be in the description label Nov 1, 2024
@AdamTadeusz AdamTadeusz requested a review from a team November 1, 2024 21:01
brysondev
brysondev previously approved these changes Nov 2, 2024
@@ -16,6 +19,7 @@ struct PS_INPUT
float4 main( const PS_INPUT i ) : COLOR
{
const float4 fbColor = tex2D(FrameBuffer, i.texCoord);
const float avgBright = (fbColor.r + fbColor.g + fbColor.b) * 0.3333;
return tex2D(TvTexture, float2(min(1.0, avgBright + g_XOffset), 0.5)) * g_BrightnessScale;
const float noise = 0.9 + (tex2D(NoiseTexture, i.texCoord + float2(g_XNoiseOffset, g_YNoiseOffset)) / 10);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit tabs

@@ -16,6 +19,7 @@ struct PS_INPUT
float4 main( const PS_INPUT i ) : COLOR
{
const float4 fbColor = tex2D(FrameBuffer, i.texCoord);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit tabs

@@ -16,7 +17,8 @@ BEGIN_SHADER_PARAMS
SHADER_PARAM(FBTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "_rt_ThermalVision", "")
//SHADER_PARAM(BLURTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "_rt_SmallHDR0", "")
SHADER_PARAM(TVTEXTURE, SHADER_PARAM_TYPE_TEXTURE, "dev/tvgrad2", "")
//SHADER_PARAM(NOISETEXTURE, SHADER_PARAM_TYPE_TEXTURE, "dev/noise", "")
SHADER_PARAM(NOISETEXTURE, SHADER_PARAM_TYPE_TEXTURE, "dev/noise", "")
SHADER_PARAM(NOISETRANSFORM, SHADER_PARAM_TYPE_VEC3, "Vector(0, 0, 0)", "")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Possibly invalid syntax for SHADER_PARAM_TYPE_VEC3 value, perhaps use [0 0 0] instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This tutorial https://developer.valvesoftware.com/wiki/Source_SDK_2013:_Your_Second_Shader uses brackets, I've also seen just a few numbers with no brackets somewhere else in the wiki

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changes in neoAssets This PR depends on changes in the neoAssets repository. The relevant PR should be in the description
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants