-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: master
Are you sure you want to change the base?
Thermals V3 #776
Conversation
@@ -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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)", "") |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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
Linked Issues