Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Extra/Shaders/NewVegasReloaded/Effects/Bloom.fx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static const float2 BlurOffsets[cKernelSize] =

float3 AdjustSaturation(float3 color, float saturation)
{
float grey = dot(color, float3(0.3, 0.59, 0.11));
float grey = dot(color, float3(0.2126, 0.7152, 0.0722));

return lerp(grey, color, saturation);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ float4 alphaBlend(float4 base, float4 blend)

float Luma(float4 input)
{
float greyscale = input.r * 0.3f + input.g * 0.59f +input.b * 0.11f;
float greyscale = input.r * 0.2126f + input.g * 0.7152f +input.b * 0.0722f;
return greyscale;
}

Expand Down
2 changes: 1 addition & 1 deletion Extra/Shaders/NewVegasReloaded/Effects/LowHF.fx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ float4 TESR_LowHFData;

sampler2D TESR_RenderedBuffer : register(s0) = sampler_state { ADDRESSU = CLAMP; ADDRESSV = CLAMP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };

static const float3 LuminanceConv = { 0.2125f, 0.7154f, 0.0721f };
static const float3 LuminanceConv = { 0.2126f, 0.7152f, 0.0722f };

struct VSOUT
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ float4 Shadow( VSOUT IN ) : COLOR0 {

float Luma(float3 input)
{
return input.r * 0.3f + input.g * 0.59f +input.b * 0.11f;
return input.r * 0.2126f + input.g * 0.7152f +input.b * 0.0722f;
}

float4 CombineShadow( VSOUT IN ) : COLOR0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ float ExponentialFog(float posHeight, float distance) {

float Luma(float3 input)
{
return input.r * 0.3f + input.g * 0.59f +input.b * 0.11f;
return input.r * 0.2126f + input.g * 0.7152f +input.b * 0.0722f;
}

float4 VolumetricFog(VSOUT IN) : COLOR0 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct VS_OUTPUT {
VS_OUTPUT main(VS_INPUT IN) {
VS_OUTPUT OUT;

const float4 const_0 = {0.299, 0.587000012, 0.114, 0};
const float4 const_0 = {0.2126, 0.7152, 0.0722, 0}; // BT.709 luma vector

float1 q0;
float3 q1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#define shade(n, l) max(dot(n, l), 0)
#define shades(n, l) saturate(dot(n, l))
#define invlerp(a, b, t) (t-a)/(b-a)
#define luma(color) color.r * 0.3f + color.g * 0.59f +color.b * 0.11f; // extract luma
#define luma(color) color.r * 0.2126f + color.g * 0.7152f +color.b * 0.0722f; // extract luma (BT.709)
#define mix(colora, colorb) colora * colorb * 2 // mix two colors without darkening
#define weight(v) dot(v, 1)
#define sqr(v) ((v) * (v))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ float4 Combine(VSOUT IN) : COLOR0
{
float3 color = tex2D(TESR_SourceBuffer, IN.UVCoord).rgb;
float ao = tex2D(TESR_RenderedBuffer, IN.UVCoord).r;
float luminance = color.r * 0.3 + color.g * 0.59 + color.b * 0.11;
float luminance = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;
float white = 1.0;
float black = 0.0;
float lt = luminance - TESR_AmbientOcclusionData.y;
Expand Down
2 changes: 1 addition & 1 deletion Extra/Shaders/OblivionReloaded/Effects/Bloom.fx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static const float2 BlurOffsets[cKernelSize] =

float3 AdjustSaturation(float3 color, float saturation)
{
float grey = dot(color, float3(0.3, 0.59, 0.11));
float grey = dot(color, float3(0.2126, 0.7152, 0.0722));

return lerp(grey, color, saturation);
}
Expand Down
2 changes: 1 addition & 1 deletion Extra/Shaders/OblivionReloaded/Effects/LowHF.fx.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ float4 TESR_LowHFData;

sampler2D TESR_RenderedBuffer : register(s0) = sampler_state { ADDRESSU = CLAMP; ADDRESSV = CLAMP; MAGFILTER = LINEAR; MINFILTER = LINEAR; MIPFILTER = LINEAR; };

static const float3 LuminanceConv = { 0.2125f, 0.7154f, 0.0721f };
static const float3 LuminanceConv = { 0.2126f, 0.7152f, 0.0722f };

struct VSOUT
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ float4 alphaBlend(float4 base, float4 blend)

float4 Desaturate(float4 input)
{
float greyscale = input.r * 0.3f + input.g * 0.59f +input.b * 0.11f;
float greyscale = input.r * 0.2126f + input.g * 0.7152f +input.b * 0.0722f;
return float4(greyscale, greyscale, greyscale, input.a);
}

Expand Down
4 changes: 2 additions & 2 deletions Extra/Shaders/OblivionReloaded/Shaders/Includes/Common.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ float3 screen(float3 a, float3 b, float w) {
}

float get_average(float3 col) {
return dot(col, 0.333);
return dot(col, 0.33333333);
}

float get_luminosity(float3 col) {
return max(col.r, max(col.g, col.b));
}

float get_luma(float3 col) {
return max(dot(col, float3(0.299, 0.587, 0.114)), 0.001);
return max(dot(col, float3(0.2126, 0.7152, 0.0722)), 0.001);

Choose a reason for hiding this comment

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

this seems to be for use on gamma encoded values
those should be converted to linear first and this can't be used

}

float get_luma_linear(float3 col) {
Expand Down