Hi Satsuki, thanks a lot for this insane job!check that you don't have 2 battle folder:
I have an annoyng issue, I cannot load the battle texture, but everiting else work great.
The battle textures are copied inside my mods\Reunion\battle, but arent loaded during battle.
Please help me.
check that you don't have 2 battle folder:
mods\Reunion\battle\STAGE01_T00_00.png ///// right
mods\Reunion\battle\battle\STAGE01_T00_00.png ///// wrong
check also that you don't have a direct folder with battle files in it
/*===============================================================================*\
|####################### [FINAL FANTASY 7 SHADER FX] ########################|
|######################### By Sunwalker 21/Jan/2017 ##########################|
|| Version 1.04 ||
|| ||
|| This program is free software; you can redistribute it and/or ||
|| modify it under the terms of the GNU General Public License ||
|| as published by the Free Software Foundation; either version 2 ||
|| of the License, or (at your option) any later version. ||
|| ||
|| This program is distributed in the hope that it will be useful, ||
|| but WITHOUT ANY WARRANTY; without even the implied warranty of ||
|| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ||
|| GNU General Public License for more details. (c)2016 ||
|| ||
|#################################################################################|
\*===============================================================================*/
#version 120
//#extension GL_ARB_texture_rectangle : enable
/*------------------------------------------------------------------------------
[DEFINITIONS & ON/OFF OPTIONS]
------------------------------------------------------------------------------*/
//--------------------------#[CHOOSE EFFECTS]#--------------------------------\\
//#[ANTIALIASING TECHNIQUES] [1=ON|0=OFF] # NOTE: Enable one only
#define USE_FXAA 0 //# [0 or 1] FXAA Fast Anti-aliasing : Smoothens jagged lines using the FXAA technique.
#define USE_AABUMPMAP 0 //# Bump Map Shader with AA
//#[LIGHTING & COLOUR] [1=ON|0=OFF] # NOTE: This one can enable all
#define GAMMA_CORRECTION 1 //# RGB Gamma Correction. Fixed expansion to variable compression gamma correction curve.
#define BLENDED_BLOOM 1 //# High Quality SP Bloom. Soft lighting with blending techniques, for a natural looking bloom.
#define SCENE_TONEMAPPING 1 //# HDR Scene Tonemapping. Layered component conversion, and applies scene tone mapping.
#define COLOR_CORRECTION 1 //# Component Color Correction. Colorspace conversion, with correction curves, and multiple palette types.
#define CROSS_PROCESSING 0 //# Filmic Cross Processing. Alters the tone of the scene, crossing the game's color set, with another.
#define COLOR_GRADING 0 //# Post-Complement Colour Grading. Alters individual colour components on a scene, to enhance selected colour tones.
//#[MISC] [1=ON|0=OFF] # NOTE: Enable one only
#define USE_SCANLINES 1 //# Scanlines to simulate the look of a CRT TV. Typically suited to sprite games.
#define NTSC_TV_EMULATION 0 //# SimoneT's TV Colors Emulation Shader. Use to emulate the original PSX color space tone, and vibrancy.
/*------------------------------------------------------------------------------
[EFFECT CONFIG OPTIONS]
------------------------------------------------------------------------------*/
//##[USE_AABUMPMAP]
#define Bump 1.33 //[0.00 to 1.70] Effect strenght - lower values bring more effect
#define Glow 1.25 //[1.00 to 1.50] Max brightness on borders
#define Shde 0.75 //[0.00 to 1.00] Max darkening
#define Range 1.0 //[0.00 to 1.00] Range width
//##[GAMMA_CORRECTION]
#define Gamma 2.20 //[1.5 to 4.0] Gamma correction. Decrease for lower gamma(darker). Increase for higher gamma(brighter). (Default: 2.2)
//##[BLENDED_BLOOM]
#define BloomType BlendAddGlow //[BlendGlow, BlendAddGlow, BlendAddLight, BlendScreen, BlendLuma, BlendOverlay] The type of blended bloom. Light<->Dark.
#define BloomStrength 0.200 //[0.000 to 1.000] Overall strength of the bloom. You may want to readjust for each blend type.
#define BlendStrength 1.000 //[0.000 to 1.000] Strength of the blending. This is a modifier based on bloom. 1.0 equates to 100% strength.
#define BloomDefocus 2.000 //[1.000 to 4.000] The initial bloom defocus value. Increases the softness of light, bright objects, etc.
#define BloomWidth 3.200 //[1.000 to 8.000] Width of the bloom. Adjusts the width of the spread and soft glow. Scales with BloomStrength.
#define BloomReds 0.040 //[0.000 to 1.000] Red channel correction of the bloom. Raising will increase the bloom of reds.
#define BloomGreens 0.030 //[0.000 to 1.000] Green channel correction of the bloom. Raising will increase the bloom of greens.
#define BloomBlues 0.020 //[0.000 to 1.000] Blue channel correction of the bloom. Raising will increase the bloom of blues.
//##[SCENE_TONEMAPPING]
#define TonemapType 2 //[0|1|2|3] The base tone mapping operator. 0 is LDR, 1 is HDR(original), 2 & 3 are Filmic HDR(slight grading).
#define TonemapMask 1 //[0 or 1] Enables an ALU tone masking curve. Produces a nice cinematic look. Suits some games more than others.
#define MaskStrength 0.10 //[0.000 to 1.000] Strength of the tone masking. Higher for a stronger effect. This is a dependency of TonemapMask.
#define ToneAmount 0.360 //[0.050 to 1.000] Tonemap strength (tone correction). Higher for stronger tone mapping, lower for lighter.
#define BlackLevels 0.000 //[0.000 to 1.000] Black level balance (shadow correction). Increase to deepen blacks, lower to lighten them.
#define Exposure 1.000 //[0.100 to 2.000] White correction (brightness). Higher values for more scene exposure, lower for less.
#define Luminance 1.000 //[0.100 to 2.000] Luminance average (luminance correction). Higher values will lower scene luminance average.
#define WhitePoint 1.075 //[0.100 to 2.000] Whitepoint average (wp lum correction). Higher values will lower the maximum scene white point.
//##[COLOR_CORRECTION]
#define CorrectionPalette 1 //[1|2|3|4|5] The colorspace palette type. 1: RGB, 2: YXY, 3: XYZ, 4: HSV, 5: YUV. Each one will produce a different combination of shades & hues.
#define ChannelR 1.40 //[0.00 to 8.00] R(1), Y(2), X(3), H(4), Y(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define ChannelG 1.60 //[0.00 to 8.00] G(1), X(2), Y(3), S(4), U(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define ChannelB 1.80 //[0.00 to 8.00] B(1), Y(2), Z(3), V(4), V(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define PaletteStrength 2.00 //[0.00 to 4.00] The interpolated strength ratio between the base color, and the corrected color. Raise to increase saturation.
//##[CROSS_PROCESSING]
#define FilmicProcess 1 //[1|2|3] The color conversion type for the cross process. 1: cool, 2: warm, 3: dusk. You can achieve different results with each.
#define RedShift 0.50 //[0.10 to 1.00] Red color component shift of the filmic processing. Alters the red balance of the shift.
#define GreenShift 0.50 //[0.10 to 1.00] Green color component shift of the filmic processing. Alters the green balance of the shift.
#define BlueShift 0.50 //[0.10 to 1.00] Blue color component shift of the filmic processing. Alters the blue balance of the shift.
#define ShiftRatio 0.50 //[0.10 to 2.00] The blending ratio for the base color and the color shift. Higher for a stronger effect.
//##[COLOR_GRADING]
#define RedGrading 1.20 //[0.00 to 3.00] Red colour grading coefficient. Adjust to influence the red channel coefficients of the grading, and highlight tones.
#define GreenGrading 1.10 //[0.00 to 3.00] Green colour grading coefficient. Adjust to influence the Green channel coefficients of the grading, and highlight tones.
#define BlueGrading 1.10 //[0.00 to 3.00] Blue colour grading coefficient. Adjust to influence the Blue channel coefficients of the grading, and highlight tones.
#define GradingStrength 0.25 //[0.00 to 1.00] The overall max strength of the colour grading effect. Raise to increase, lower to decrease the amount.
#define Correlation 1.00 //[0.10 to 1.00] Correlation between the base colour, and the grading influence. Lower = more of the scene is graded, Higher = less of the scene is graded.
//##[USE_SCANLINES]
#define Scanlines 0.20 //[default 0.25]
#define Brighten 0.30 //[default 0.40]
#define Colorshift 0.50 //[default 0.50]
#define Lineblur 0.50 //[default 0.50]
#define Phosphorgrid 0.00 //[default 0.20]
#define Screencurve 0.00 //[default 0.15]
#define Lines 272.0 //[default 272.0] For use with arcade conversions such as SFA3, Darkstalkers or Metal Slug. Change this to 224.0 and change PPSSPP's internal rendering resolution by 2x, to align the scanlines to the game's original arcade resolution.
#define xRES_u 1920.0 //[default 1920.0] This is the on-screen resolution of the emulation's output frame,
#define yRES_u 1088.0 //[default 1088.0] keep in mind the PSP's odd 16/9.06667 screen ratio.
//##[TEXTURE_SIZE]
#define pixelWidth 1024.0 //[1024 to 4096]
#define pixelHeight 512.0 //[512 to 2048]
#define Quality 1. //[0.5 to 1.0]
//[END OF USER OPTIONS]
/*------------------------------------------------------------------------------
[GLOBALS|FUNCTIONS]
------------------------------------------------------------------------------*/
//Global variables
#define SamplerState sampler2D
#define saturate(x) clamp(x, 0.0, 1.0)
#define lerp mix
#define frac fract
#define fmod mod
#define mul(x, y) (y * x)
#define float4x3 mat4x3
#define float3x3 mat3
#define float4x4 mat4
#define lumCoeff vec3(0.212656, 0.715158, 0.072186)
//OGL Uniforms
uniform vec4 OGLParam[4];
uniform sampler2D OGLTexture;
uniform sampler2D OGLTexture0;
//varying
uniform vec2 texcoord;
uniform vec4 color;
float Epsilon = 1e-10;
float xy = (Quality / pixelWidth, Quality / pixelHeight, Quality, 0.0);
//float y = (Quality / pixelHeight, 0.0);
vec2 OGLSize = vec2(pixelWidth, pixelHeight);
vec2 OGLInvSize = vec2(Quality / pixelWidth, Quality / pixelHeight);
//Average Relative Luminance (HSP Color Model)
//return (0.2126 * color.x) + (0.7152 * color.y) + (0.0722 * color.z);
float AvgLuminance(vec3 color)
{
return sqrt(dot(color * color, lumCoeff));
}
/*float smootherstep(float a, float b, float x)
{
x = clamp((x - a) / (b - a), 0.0, 1.0);
return x*x*x*(x*(x * 6 - 15) + 10);
}*/
//Smoothstep alt
float smootherstep(float a, float b, float x)
{
x = saturate((x - a) / (b - a));
return x*x*x*(x*(x * 6 - 15) + 10);
}
//Check for OOB rgb clipping
vec4 DebugClipping(vec4 color)
{
if (color.x >= 0.99999 && color.y >= 0.99999 &&
color.z >= 0.99999) color.xyz = vec3(1.0f, 0.0f, 0.0f);
if (color.x <= 0.00001 && color.y <= 0.00001 &&
color.z <= 0.00001) color.xyz = vec3(0.0f, 0.0f, 1.0f);
return color;
}
//Conversion matrices
vec3 RGBtoXYZ(vec3 RGB)
{
const mat3 RGBtoXYZ = mat3(
0.6068909, 0.1735011, 0.2003480,
0.2989164, 0.5865990, 0.1144845,
0.0000000, 0.0660957, 1.1162243);
return RGBtoXYZ*RGB;
}
vec3 XYZtoRGB(vec3 XYZ)
{
const mat3 XYZtoRGB = mat3(
1.9099961, -0.5324542, -0.2882091,
-0.9846663, 1.9991710, -0.0283082,
0.0583056, -0.1183781, 0.8975535);
return XYZtoRGB*XYZ;
}
vec3 XYZtoSRGB(vec3 XYZ)
{
const mat3 XYZtoSRGB = mat3(
3.2404542, -1.5371385, -0.4985314,
-0.9692660, 1.8760108, 0.0415560,
0.0556434, -0.2040259, 1.0572252);
return XYZtoSRGB*XYZ;
}
vec3 RGBtoYUV(vec3 RGB)
{
const mat3 RGBtoYUV = mat3(
0.2126, 0.7152, 0.0722,
-0.09991, -0.33609, 0.436,
0.615, -0.55861, -0.05639);
return RGBtoYUV*RGB;
}
vec3 YUVtoRGB(vec3 YUV)
{
const mat3 YUVtoRGB = mat3(
1.000, 0.000, 1.28033,
1.000, -0.21482, -0.38059,
1.000, 2.12798, 0.000);
return YUVtoRGB*YUV;
}
vec3 XYZtoYxy(vec3 XYZ)
{
float w = (XYZ.r + XYZ.g + XYZ.b);
vec3 Yxy;
Yxy.r = XYZ.g;
Yxy.g = XYZ.r / w;
Yxy.b = XYZ.g / w;
return Yxy;
}
vec3 YxytoXYZ(vec3 Yxy)
{
vec3 XYZ;
XYZ.g = Yxy.r;
XYZ.r = Yxy.r * Yxy.g / Yxy.b;
XYZ.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
return XYZ;
}
/*------------------------------------------------------------------------------
[FXAA CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
Code from http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/3/
Credit to original Author
------------------------------------------------------------------------------*/
#if USE_FXAA == 1
vec3 FxaaPixelShader(sampler2D OGLTexture, vec2 texcoord)
{
float FXAA_SPAN_MAX = 8.0; //[4.0 t0 8.0]
float FXAA_REDUCE_MUL = (1.0 / FXAA_SPAN_MAX); //[Default]
float FXAA_REDUCE_MIN = (1.0 / 128.0); //[Default]
float FXAA_SUBPIX_SHIFT = (1.0 / 4.0); //[Default]
vec4 posPos = vec4(texcoord.xy, texcoord.xy - (OGLInvSize * (0.5 + FXAA_SUBPIX_SHIFT)));
/*---------------------------------------------------------*/
vec3 rgbNW = texture2D(OGLTexture, posPos.zw, 0.0).rgb;
vec3 rgbNE = texture2D(OGLTexture, posPos.zw + vec2(1., 0.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbSW = texture2D(OGLTexture, posPos.zw + vec2(0., 1.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbSE = texture2D(OGLTexture, posPos.zw + vec2(1., 1.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbM = texture2D(OGLTexture, texcoord.xy, 0.0).rgb;
/*---------------------------------------------------------*/
//vec3 luma = vec3(0.299, 0.587, 0.114);
float lumaNW = AvgLuminance(rgbNW);
float lumaNE = AvgLuminance(rgbNE);
float lumaSW = AvgLuminance(rgbSW);
float lumaSE = AvgLuminance(rgbSE);
float lumaM = AvgLuminance(rgbM);
/*---------------------------------------------------------*/
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
/*---------------------------------------------------------*/
vec2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
/*---------------------------------------------------------*/
float dirReduce = max(
(lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),
FXAA_REDUCE_MIN);
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * OGLInvSize.xy;
/*--------------------------------------------------------*/
vec3 rgbA = (1.0 / 2.0) * (
texture2D(OGLTexture, texcoord.xy + dir * (1.0 / 3.0 - 0.5)).rgb +
texture2D(OGLTexture, texcoord.xy + dir * (2.0 / 3.0 - 0.5)).rgb);
vec3 rgbB = rgbA * (1.0 / 2.0) + (1.0 / 4.0) * (
texture2D(OGLTexture, texcoord.xy + dir * (0.0 / 3.0 - 0.5)).rgb +
texture2D(OGLTexture, texcoord.xy + dir * (3.0 / 3.0 - 0.5)).rgb);
float lumaB = AvgLuminance(rgbB);
if ((lumaB < lumaMin) || (lumaB > lumaMax)) {
return rgbA.rgb;
}
else {
return rgbB.rgb;
}
}
vec4 FXAAPass(vec4 Fxaa, vec2 texcoord)
{
Fxaa.rgb = FxaaPixelShader(OGLTexture, texcoord);
Fxaa.a = AvgLuminance(Fxaa.rgb);
return Fxaa.rgb;
}
#endif
/*------------------------------------------------------------------------------
[BUMP MAPPING with AA SHADER CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
Copyright(C) 2011 - 2015 guest(r) - [email protected]
Credit to Guest r.
------------------------------------------------------------------------------*/
#if USE_AABUMPMAP == 1
vec3 BumpMapping(sampler2D OGLTexture, vec2 texcoord)
{
float x = (Range / pixelWidth);
float y = (Range / pixelHeight);
vec2 dg1 = vec2(x, y);
vec2 dg2 = vec2(-x, y);
vec2 dx = vec2(x, 0.0)*.5;
vec2 dy = vec2(0.0, y)*.5;
vec2 u_Tex0 = texcoord;
vec4 u_Tex1 = vec4(u_Tex0 - dy, u_Tex0 - dg2);
vec4 u_Tex2 = vec4(u_Tex0 + dy, u_Tex0 + dg2);
vec4 u_Tex3 = vec4(u_Tex0 - dx, u_Tex0 - dg2);
vec4 u_Tex4 = vec4(u_Tex0 + dx, u_Tex0 + dg2);
vec4 u_Tex5 = vec4(u_Tex0 - dg1, u_Tex0 - dg2);
vec4 u_Tex6 = vec4(u_Tex0 + dg1, u_Tex0 + dg2);
vec3 c10 = texture2D(OGLTexture, u_Tex1.xy).rgb;
vec3 c12 = texture2D(OGLTexture, u_Tex2.xy).rgb;
vec3 c01 = texture2D(OGLTexture, u_Tex3.xy).rgb;
vec3 c21 = texture2D(OGLTexture, u_Tex4.xy).rgb;
vec3 c00 = texture2D(OGLTexture, u_Tex5.xy).rgb;
vec3 c22 = texture2D(OGLTexture, u_Tex6.xy).rgb;
vec3 c11 = texture2D(OGLTexture, u_Tex0.xy).rgb;
vec3 c02 = texture2D(OGLTexture, u_Tex1.zw).rgb;
vec3 c20 = texture2D(OGLTexture, u_Tex2.zw).rgb;
vec3 dt = vec3(1.0, 1.0, 1.0);
float d1 = dot(abs(c00 - c22), dt) + 0.0001;
float d2 = dot(abs(c20 - c02), dt) + 0.0001;
float hl = dot(abs(c01 - c21), dt) + 0.0001;
float vl = dot(abs(c10 - c12), dt) + 0.0001;
float md = d1 + d2;
float mc = hl + vl;
hl *= md;
vl *= md;
d1 *= mc;
d2 *= mc;
float ww = d1 + d2 + hl + vl;
vec3 d11 = (hl*(c10 + c12) + vl*(c01 + c21) + d1*(c20 + c02) + d2*(c00 + c22) + ww*c11) / (3.0*ww);
c11 = (-c00 + c22 - c01 + c21 - c10 + c12 + Bump*d11) / Bump;
c11 = min(c11, Glow*d11);
c11 = max(c11, Shde*d11);
return c11;
}
vec4 BumpMappingPass(vec4 color, vec2 texcoord)
{
color.rgb = BumpMapping(OGLTexture, texcoord);
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[GAMMA CORRECTION CODE SECTION]
------------------------------------------------------------------------------*/
vec3 EncodeGamma(vec3 color, float gamma)
{
color = saturate(color);
color.r = (color.r <= 0.0404482362771082) ? color.r / 12.92 : pow((color.r + 0.055) / 1.055, gamma);
color.g = (color.g <= 0.0404482362771082) ? color.g / 12.92 : pow((color.g + 0.055) / 1.055, gamma);
color.b = (color.b <= 0.0404482362771082) ? color.b / 12.92 : pow((color.b + 0.055) / 1.055, gamma);
return color;
}
vec3 DecodeGamma(vec3 color, float gamma)
{
color = saturate(color);
color.r = (color.r <= 0.00313066844250063) ? color.r * 12.92 : 1.055 * pow(color.r, 1.0 / gamma) - 0.055;
color.g = (color.g <= 0.00313066844250063) ? color.g * 12.92 : 1.055 * pow(color.g, 1.0 / gamma) - 0.055;
color.b = (color.b <= 0.00313066844250063) ? color.b * 12.92 : 1.055 * pow(color.b, 1.0 / gamma) - 0.055;
return color;
}
#if GAMMA_CORRECTION == 1
vec4 GammaPass(vec4 color, vec2 texcoord)
{
const float GammaConst = 2.233333;
color.rgb = EncodeGamma(color.rgb, GammaConst);
color.rgb = DecodeGamma(color.rgb, float(Gamma));
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[BLENDED BLOOM CODE SECTION]
------------------------------------------------------------------------------*/
#if BLENDED_BLOOM == 1
vec3 BlendAddLight(vec3 bloom, vec3 blend)
{
return saturate(bloom + blend);
}
vec3 BlendScreen(vec3 bloom, vec3 blend)
{
return (bloom + blend) - (bloom * blend);
}
vec3 BlendGlow(vec3 bloom, vec3 blend)
{
float glow = AvgLuminance(bloom);
return lerp((bloom + blend) - (bloom * blend), (blend + blend) - (blend * blend), glow);
}
vec3 BlendAddGlow(vec3 bloom, vec3 blend)
{
float addglow = smootherstep(0.0, 1.0, AvgLuminance(bloom));
return lerp(saturate(bloom + blend), (blend + blend) - (blend * blend), addglow);
}
vec3 BlendLuma(vec3 bloom, vec3 blend)
{
float lumavg = smootherstep(0.0, 1.0, AvgLuminance(bloom + blend));
return lerp((bloom * blend), (1.0 - ((1.0 - bloom) * (1.0 - blend))), lumavg);
}
vec3 BlendOverlay(vec3 bloom, vec3 blend)
{
vec3 overlay = step(0.5, bloom);
return lerp((bloom * blend * 2.0), (1.0 - (2.0 *(1.0 - bloom) * (1.0 - blend))), overlay);
}
vec3 BloomCorrection(vec3 color)
{
vec3 bloom = color;
bloom.r = 2.0 / 3.0 * (1.0 - (bloom.r * bloom.r));
bloom.g = 2.0 / 3.0 * (1.0 - (bloom.g * bloom.g));
bloom.b = 2.0 / 3.0 * (1.0 - (bloom.b * bloom.b));
bloom.r = saturate(color.r + float(BloomReds) * bloom.r);
bloom.g = saturate(color.g + float(BloomGreens) * bloom.g);
bloom.b = saturate(color.b + float(BloomBlues) * bloom.b);
color = bloom;
return color;
}
vec4 DefocusFilter(sampler2D OGLTexture, vec2 texcoord, vec2 defocus)
{
defocus = clamp(defocus, 1.0, 1.5);
vec2 texel = OGLInvSize * defocus;
vec4 sampleA = texture2D(OGLTexture, texcoord + vec2(0.5, 0.5) * texel);
vec4 sampleB = texture2D(OGLTexture, texcoord + vec2(-0.5, 0.5) * texel);
vec4 sampleC = texture2D(OGLTexture, texcoord + vec2(0.5, -0.5) * texel);
vec4 sampleD = texture2D(OGLTexture, texcoord + vec2(-0.5, -0.5) * texel);
float fx = frac(texcoord.x * OGLSize.x);
float fy = frac(texcoord.y * OGLSize.y);
vec4 interpolateA = lerp(sampleA, sampleB, fx);
vec4 interpolateB = lerp(sampleC, sampleD, fx);
return lerp(interpolateA, interpolateB, fy);
}
vec4 BloomPass(vec4 color, vec2 texcoord)
{
float anflare = 4.0;
float width = BloomWidth;
vec2 defocus = vec2(BloomDefocus, BloomDefocus);
vec4 bloom = DefocusFilter(OGLTexture, texcoord, defocus);
vec2 dx = vec2(OGLInvSize.x * width, 0.0);
vec2 dy = vec2(0.0, OGLInvSize.y * width);
vec2 mdx = vec2(dx.x * defocus.x, 0.0);
vec2 mdy = vec2(0.0, dy.y * defocus.y);
vec4 blend = bloom * 0.22520613262190495;
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord - mdx + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - dx + mdy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + dx + mdy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord + mdx + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - mdx + dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord - dx + dy);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord + dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord + dx + dy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + mdx + dy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord - mdx);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord - dx);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord + dx);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord + mdx);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - mdx - dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord - dx - dy);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord - dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord + dx - dy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + mdx - dy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord - mdx - mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - dx - mdy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord - mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + dx - mdy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord + mdx - mdy);
blend = lerp(color, blend, float(BlendStrength));
bloom.xyz = BloomType(bloom.xyz, blend.xyz);
bloom.xyz = BloomCorrection(bloom.xyz);
color.w = AvgLuminance(color.xyz);
bloom.w = AvgLuminance(bloom.xyz);
bloom.w *= anflare;
color = lerp(color, bloom, float(BloomStrength));
return color;
}
#endif
/*------------------------------------------------------------------------------
[SCENE TONE MAPPING CODE SECTION]
------------------------------------------------------------------------------*/
#if SCENE_TONEMAPPING == 1
vec3 ScaleLuminance(vec3 x)
{
float W = 1.02; // WhitePoint Scale
float L = 0.16; // Luminance Scale
float C = 1.02; // Compression Scale
float N = clamp(0.82 + ToneAmount, 1.0, 2.0);
float K = (N - L * C) / C;
vec3 tone = L * C + (1.0 - L * C) * (1.0 + K * (x - L) / ((W - L) * (W - L))) * (x - L) / (x - L + K);
vec3 color;
color.r = (x.r > L) ? tone.r : C * x.r;
color.g = (x.g > L) ? tone.g : C * x.g;
color.b = (x.b > L) ? tone.b : C * x.b;
return color;
}
vec3 TmMask(vec3 color)
{
vec3 tone = color;
float highTone = 6.2;
float greyTone = 0.4;
float midTone = 1.62;
float lowTone = 0.06;
tone.r = (tone.r * (highTone * tone.r + greyTone)) / (tone.r * (highTone * tone.r + midTone) + lowTone);
tone.g = (tone.g * (highTone * tone.g + greyTone)) / (tone.g * (highTone * tone.g + midTone) + lowTone);
tone.b = (tone.b * (highTone * tone.b + greyTone)) / (tone.b * (highTone * tone.b + midTone) + lowTone);
const float gamma = 2.42;
tone = EncodeGamma(tone, gamma);
color = lerp(color, tone, float(MaskStrength));
return color;
}
vec3 TmCurve(vec3 color)
{
vec3 T = color;
float tnamn = ToneAmount;
float blevel = length(T);
float bmask = pow(blevel, 0.02);
float A = 0.100; float B = 0.300;
float C = 0.100; float D = tnamn;
float E = 0.020; float F = 0.300;
float W = 1.000;
T.r = ((T.r*(A*T.r + C*B) + D*E) / (T.r*(A*T.r + B) + D*F)) - E / F;
T.g = ((T.g*(A*T.g + C*B) + D*E) / (T.g*(A*T.g + B) + D*F)) - E / F;
T.b = ((T.b*(A*T.b + C*B) + D*E) / (T.b*(A*T.b + B) + D*F)) - E / F;
float denom = ((W*(A*W + C*B) + D*E) / (W*(A*W + B) + D*F)) - E / F;
vec3 black = vec3(bmask, bmask, bmask);
vec3 white = vec3(denom, denom, denom);
T = T / white;
T = T * black;
color = saturate(T);
return color;
}
vec4 TonemapPass(vec4 color, vec2 texcoord)
{
float L = Luminance;
vec3 tonemap = color.rgb;
vec3 luma = vec3(L, L, L);
float blackLevel = length(tonemap);
tonemap = ScaleLuminance(tonemap);
float luminanceAverage = AvgLuminance(luma);
if (TonemapMask == 1) { tonemap = TmMask(tonemap); }
if (TonemapType == 1) { tonemap = TmCurve(tonemap); }
// RGB -> XYZ conversion
vec3 XYZ = RGBtoXYZ(tonemap);
// XYZ -> Yxy conversion
vec3 Yxy;
Yxy.r = XYZ.g; // copy luminance Y
Yxy.g = XYZ.r / (XYZ.r + XYZ.g + XYZ.b); // x = X / (X + Y + Z)
Yxy.b = XYZ.g / (XYZ.r + XYZ.g + XYZ.b); // y = Y / (X + Y + Z)
// (Wt) Tone mapped scaling of the initial wp before input modifiers
float Wt = saturate(Yxy.r / AvgLuminance(XYZ));
if (TonemapType == 2) { Yxy.r = TmCurve(Yxy).r; }
// (Lp) Map average luminance to the middlegrey zone by scaling pixel luminance
float Lp = Yxy.r * float(Exposure) / (luminanceAverage + Epsilon);
// (Wp) White point calculated, based on the toned white, and input modifier
float Wp = dot(abs(Wt), float(WhitePoint));
// (Ld) Scale all luminance within a displayable range of 0 to 1
Yxy.r = (Lp * (1.0 + Lp / (Wp * Wp))) / (1.0 + Lp);
// Yxy -> XYZ conversion
XYZ.r = Yxy.r * Yxy.g / Yxy.b; // X = Y * x / y
XYZ.g = Yxy.r; // copy luminance Y
XYZ.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; // Z = Y * (1-x-y) / y
if (TonemapType == 3) { XYZ = TmCurve(XYZ); }
// XYZ -> RGB conversion
tonemap = XYZtoRGB(XYZ);
float shadowmask = pow(saturate(blackLevel), float(BlackLevels));
tonemap = tonemap * vec3(shadowmask, shadowmask, shadowmask);
color.rgb = tonemap;
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[COLOR CORRECTION CODE SECTION]
------------------------------------------------------------------------------*/
// Converting pure hue to RGB
vec3 HUEtoRGB(float H)
{
float R = abs(H * 6.0 - 3.0) - 1.0;
float G = 2.0 - abs(H * 6.0 - 2.0);
float B = 2.0 - abs(H * 6.0 - 4.0);
return saturate(vec3(R, G, B));
}
// Converting RGB to hue/chroma/value
vec3 RGBtoHCV(vec3 RGB)
{
vec4 BG = vec4(RGB.bg, -1.0, 2.0 / 3.0);
vec4 GB = vec4(RGB.gb, 0.0, -1.0 / 3.0);
vec4 P = (RGB.g < RGB.b) ? BG : GB;
vec4 XY = vec4(P.xyw, RGB.r);
vec4 YZ = vec4(RGB.r, P.yzx);
vec4 Q = (RGB.r < P.x) ? XY : YZ;
float C = Q.x - min(Q.w, Q.y);
float H = abs((Q.w - Q.y) / (6.0 * C + Epsilon) + Q.z);
return vec3(H, C, Q.x);
}
// Converting RGB to HSV
vec3 RGBtoHSV(vec3 RGB)
{
vec3 HCV = RGBtoHCV(RGB);
float S = HCV.y / (HCV.z + Epsilon);
return vec3(HCV.x, S, HCV.z);
}
// Converting HSV to RGB
vec3 HSVtoRGB(vec3 HSV)
{
vec3 RGB = HUEtoRGB(HSV.x);
return ((RGB - 1.0) * HSV.y + 1.0) * HSV.z;
}
#if COLOR_CORRECTION == 1
// Pre correction color mask
vec3 PreCorrection(vec3 color)
{
vec3 RGB = color;
RGB.r = 2.0 / 3.0 * (1.0 - (RGB.r * RGB.r));
RGB.g = 2.0 / 3.0 * (1.0 - (RGB.g * RGB.g));
RGB.b = 2.0 / 3.0 * (1.0 - (RGB.b * RGB.b));
RGB.r = saturate(color.r + (float(ChannelR) / 200.0) * RGB.r);
RGB.g = saturate(color.g + (float(ChannelG) / 200.0) * RGB.g);
RGB.b = saturate(color.b + (float(ChannelB) / 200.0) * RGB.b);
color = saturate(RGB);
return color;
}
vec3 ColorCorrection(vec3 color)
{
float X = 1.0 / (1.0 + exp(float(ChannelR) / 2.0));
float Y = 1.0 / (1.0 + exp(float(ChannelG) / 2.0));
float Z = 1.0 / (1.0 + exp(float(ChannelB) / 2.0));
color.r = (1.0 / (1.0 + exp(float(-ChannelR) * (color.r - 0.5))) - X) / (1.0 - 2.0 * X);
color.g = (1.0 / (1.0 + exp(float(-ChannelG) * (color.g - 0.5))) - Y) / (1.0 - 2.0 * Y);
color.b = (1.0 / (1.0 + exp(float(-ChannelB) * (color.b - 0.5))) - Z) / (1.0 - 2.0 * Z);
return saturate(color);
}
vec4 CorrectionPass(vec4 color, vec2 texcoord)
{
vec3 colorspace = PreCorrection(color.rgb);
#if CorrectionPalette == 1
colorspace = ColorCorrection(colorspace);
#elif CorrectionPalette == 2
vec3 XYZ = RGBtoXYZ(colorspace);
vec3 Yxy = XYZtoYxy(XYZ);
Yxy = ColorCorrection(Yxy);
XYZ = YxytoXYZ(Yxy);
colorspace = XYZtoRGB(XYZ);
#elif CorrectionPalette == 3
vec3 XYZ = RGBtoXYZ(colorspace);
vec3 Yxy = XYZtoYxy(XYZ);
XYZ = YxytoXYZ(Yxy);
XYZ = ColorCorrection(XYZ);
colorspace = XYZtoRGB(XYZ);
#elif CorrectionPalette == 4
vec3 hsv = RGBtoHSV(colorspace);
hsv = ColorCorrection(hsv);
colorspace = HSVtoRGB(hsv);
#elif CorrectionPalette == 5
vec3 yuv = RGBtoYUV(colorspace);
yuv = ColorCorrection(yuv);
colorspace = YUVtoRGB(yuv);
#endif
color.rgb = lerp(color.rgb, colorspace, float(PaletteStrength));
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[CROSS PROCESSING CODE SECTION]
------------------------------------------------------------------------------*/
#if CROSS_PROCESSING == 1
vec3 CrossShift(vec3 color)
{
vec3 cross;
vec2 CrossMatrix[3] = vec2[](
vec2(0.960, 0.040 * color.x),
vec2(0.980, 0.020 * color.y),
vec2(0.970, 0.030 * color.z));
cross.x = float(RedShift) * CrossMatrix[0].x + CrossMatrix[0].y;
cross.y = float(GreenShift) * CrossMatrix[1].x + CrossMatrix[1].y;
cross.z = float(BlueShift) * CrossMatrix[2].x + CrossMatrix[2].y;
float lum = AvgLuminance(color);
vec3 black = vec3(0.0, 0.0, 0.0);
vec3 white = vec3(1.0, 1.0, 1.0);
cross = lerp(black, cross, saturate(lum * 2.0));
cross = lerp(cross, white, saturate(lum - 0.5) * 2.0);
color = lerp(color, cross, saturate(lum * float(ShiftRatio)));
return color;
}
vec4 CrossPass(vec4 color, vec2 texcoord)
{
#if FilmicProcess == 1
color.rgb = CrossShift(color.rgb);
#elif FilmicProcess == 2
vec3 XYZ = RGBtoXYZ(color.rgb);
vec3 Yxy = XYZtoYxy(XYZ);
Yxy = CrossShift(Yxy);
XYZ = YxytoXYZ(Yxy);
color.rgb = XYZtoRGB(XYZ);
#elif FilmicProcess == 3
vec3 XYZ = RGBtoXYZ(color.rgb);
vec3 Yxy = XYZtoYxy(XYZ);
XYZ = YxytoXYZ(Yxy);
XYZ = CrossShift(XYZ);
color.rgb = XYZtoRGB(XYZ);
#endif
color.a = AvgLuminance(color.rgb);
return saturate(color);
}
#endif
/*------------------------------------------------------------------------------
[COLOR GRADING CODE SECTION]
------------------------------------------------------------------------------*/
#if COLOR_GRADING == 1
float RGBCVtoHUE(vec3 RGB, float C, float V)
{
vec3 Delta = (V - RGB) / C;
Delta.rgb -= Delta.brg;
Delta.rgb += vec3(2.0, 4.0, 6.0);
Delta.brg = step(V, RGB) * Delta.brg;
float H;
H = max(Delta.r, max(Delta.g, Delta.b));
return frac(H / 6);
}
vec3 HSVComplement(vec3 HSV)
{
vec3 complement = HSV;
complement.x -= 0.5;
if (complement.x < 0.0) {
complement.x += 1.0;
}
return(complement);
}
float HueLerp(float h1, float h2, float v)
{
float d = abs(h1 - h2);
if (d <= 0.5)
{
return lerp(h1, h2, v);
}
else if (h1 < h2)
{
return frac(lerp((h1 + 1.0), h2, v));
}
else
{
return frac(lerp(h1, (h2 + 1.0), v));
}
}
vec4 ColorGradingPass(vec4 color, vec2 texcoord)
{
vec3 guide = vec3(RedGrading, GreenGrading, BlueGrading);
float amount = GradingStrength;
float correlation = Correlation;
float concentration = 2.00;
vec3 colorHSV = RGBtoHSV(color.rgb);
vec3 huePoleA = RGBtoHSV(guide);
vec3 huePoleB = HSVComplement(huePoleA);
float dist1 = abs(colorHSV.x - huePoleA.x);
if (dist1 > 0.5) dist1 = 1.0 - dist1;
float dist2 = abs(colorHSV.x - huePoleB.x);
if (dist2 > 0.5) dist2 = 1.0 - dist2;
float descent = smoothstep(0.0, correlation, colorHSV.y);
vec3 HSVColor = colorHSV;
if (dist1 < dist2) {
float c = descent * amount * (1.0 - pow((dist1 * 2.0), 1.0 / concentration));
HSVColor.x = HueLerp(colorHSV.x, huePoleA.x, c);
HSVColor.y = lerp(colorHSV.y, huePoleA.y, c);
}
else
{
float c = descent * amount * (1.0 - pow((dist2 * 2.0), 1.0 / concentration));
HSVColor.x = HueLerp(colorHSV.x, huePoleB.x, c);
HSVColor.y = lerp(colorHSV.y, huePoleB.y, c);
}
color.rgb = HSVtoRGB(HSVColor);
color.a = AvgLuminance(color.rgb);
return saturate(color);
}
#endif
/*------------------------------------------------------------------------------
[SCANLINES CODE SECTION]
------------------------------------------------------------------------------*/
//arcade scanlines by Nick
//Credit to Nick
//intended for use with the original PSP resolution (but works with high res too)
#if USE_SCANLINES == 1
//adjusting misc variables & stuff, no need to change these:
#define _PI 3.141592653
#define Shiftlines 0.75
#define Hblur 0.001 * Lineblur
#define Cshift 0.001 * Colorshift
#define Phosphor 1.0 - clamp(Phosphorgrid, 0.0, 1.0)
#define Darken 1.0 - clamp(Scanlines, 0.0, 1.0)
#define Scanwidthcurve Scanlines / 2.0
vec3 ArcadeScanlines(sampler2D OGLTexture, vec2 texcoord)
{
//TV screen curve:
//horizontal and vertical screen curve functions:
vec2 f = vec2(pow(texcoord.x - 0.5, 2.0) * Screencurve, pow(texcoord.y - 0.5, 2.0) * Screencurve * 0.567);
//applying and aligning functions to screen pixels:
vec2 curvedcoord = vec2(texcoord.x + (f.y - f.y * (1.5 - texcoord.x)), texcoord.y + (f.x - f.x * (1.5 - texcoord.y)));
//make the border outside the screen black instead of stretched colors:
float xborder = int(curvedcoord.x + 1.0);
float yborder = int(curvedcoord.y + 1.0);
//horizontal blur and color shift, and a sine based line sampler that stretches filtered pixels vertically
//to make them fit the scanlines better and prevent scanline bleed:
float sinsample = (sin(curvedcoord.y*Lines*2.0*_PI) + curvedcoord.y*Lines*2.0*_PI) / (Lines*2.0*_PI);
float r = (texture2D(OGLTexture, vec2(curvedcoord.x + Cshift, sinsample)).x + texture2D(OGLTexture, vec2(curvedcoord.x + Cshift + Hblur, sinsample)).x + texture2D(OGLTexture, vec2(curvedcoord.x + Cshift - Hblur, sinsample)).x) / (3.0 - Brighten);
float g = (texture2D(OGLTexture, vec2(curvedcoord.x - Cshift, sinsample)).y + texture2D(OGLTexture, vec2(curvedcoord.x - Cshift + Hblur, sinsample)).y + texture2D(OGLTexture, vec2(curvedcoord.x - Cshift - Hblur, sinsample)).y) / (3.0 - Brighten);
float b = (texture2D(OGLTexture, vec2(curvedcoord.x, sinsample)).z + texture2D(OGLTexture, vec2(curvedcoord.x + Hblur, sinsample)).z + texture2D(OGLTexture, vec2(curvedcoord.x - Hblur, sinsample)).z) / (3.0 - Brighten);
//phosphor rgb grid:
//rgb color lines:
int posr = int(texcoord.x * xRES_u + 2.0);
int posg = int(texcoord.x * xRES_u + 1.0);
int posb = int(texcoord.x * xRES_u);
float intr = mod(float(posr), 3.0);
float intg = mod(float(posg), 3.0);
float intb = mod(float(posb), 3.0);
r *= clamp(intg * intb, Phosphor, 1.0);
g *= clamp(intr * intb, Phosphor, 1.0);
b *= clamp(intr * intg, Phosphor, 1.0);
//breaks between phosphor rgb elements in a hexagonal pattern:
int yposPhosbreak1 = int(texcoord.y * yRES_u);
int yposPhosbreak2 = int(texcoord.y * yRES_u + 2.0);
int xposPhosbreak = int(texcoord.x * xRES_u / 3.0 - 0.333333333);
float intPhosbreak1 = mod(float(yposPhosbreak1), 4.0) + mod(float(xposPhosbreak), 2.0);
float intPhosbreak2 = mod(float(yposPhosbreak2), 4.0) + (1.0 - mod(float(xposPhosbreak), 2.0));
//final composition, phosphor seems to slightly redden image (?), so if it's on, we slightly mute r:
vec3 rgb = vec3(r*(0.9 + 0.1*Phosphor), g, b);
//apply phosphor breaks:
rgb *= clamp(intPhosbreak1*intPhosbreak2 + 0.5 + 0.5 * Phosphor, 0.0, 1.0);
//make scanlines:
rgb -= 1.0 - clamp(Darken + Scanwidthcurve*(1.0 + cos(Shiftlines*_PI + curvedcoord.y*_PI*2.0*Lines)), 0.0, 1.0);
//apply border:
rgb *= mod(float(xborder), 2.0)*mod(float(yborder), 2.0);
//pixel all done!
return rgb;
}
vec4 ScanlinesPass(vec4 color, vec2 texcoord)
{
color.rgb = ArcadeScanlines(OGLTexture, texcoord);
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[TV COLORS EMU CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
SimoneT NTSC TV colors emulation 1.0 Shader
Copyright (C) 2016 SimoneT - [email protected]
Credit to SimoneT.
------------------------------------------------------------------------------*/
#if NTSC_TV_EMULATION == 1
// conversion from NTSC RGB Reference White D65 ( color space used by NA/Japan TV's ) to XYZ
vec3 NTSC(vec3 c)
{
vec3 v = vec3(pow(c.r, 2.2), pow(c.g, 2.2), pow(c.b, 2.2)); //Inverse Companding
return v*mat3(
0.6068909, 0.1735011, 0.2003480,
0.2989164, 0.5865990, 0.1144845,
0.0000000, 0.0660957, 1.1162243);
}
// conversion from XYZ to sRGB Reference White D65 ( color space used by windows )
vec3 sRGB(vec3 c)
{
vec3 v = c*mat3(
3.2404542, -1.5371385, -0.4985314,
-0.9692660, 1.8760108, 0.0415560,
0.0556434, -0.2040259, 1.0572252);
//Companding
v.r = (v.r > 0.0031308) ? ((1.055 * pow(v.r, (1.0 / 2.4))) - 0.055) : 12.92 * v.r;
v.g = (v.g > 0.0031308) ? ((1.055 * pow(v.g, (1.0 / 2.4))) - 0.055) : 12.92 * v.g;
v.b = (v.b > 0.0031308) ? ((1.055 * pow(v.b, (1.0 / 2.4))) - 0.055) : 12.92 * v.b;
return v;
}
// NTSC RGB to sRGB
vec3 NTSCtoSRGB(vec3 c)
{
return sRGB(NTSC(c));
}
// Ported from SimoneT TV colors emulation 1.0 Shader
vec4 TvColorsPass(vec4 color, vec2 texcoord)
{
color.rgb = NTSCtoSRGB(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[MAIN() & COMBINE PASS CODE SECTION]
------------------------------------------------------------------------------*/
void main()
{
vec2 texcoord = gl_TexCoord[0].xy;
vec4 color = texture2D(OGLTexture0, texcoord);
#if USE_AABUMPMAP == 1
color = BumpMappingPass(color, texcoord);
#endif
#if USE_FXAA == 1
color = FXAAPass(color, texcoord);
#endif
#if GAMMA_CORRECTION == 1
color = GammaPass(color, texcoord);
#endif
#if BLENDED_BLOOM == 1
color = BloomPass(color, texcoord);
#endif
#if SCENE_TONEMAPPING == 1
color = TonemapPass(color, texcoord);
#endif
#if COLOR_CORRECTION == 1
color = CorrectionPass(color, texcoord);
#endif
#if CROSS_PROCESSING == 1
color = CrossPass(color, texcoord);
#endif
#if COLOR_GRADING == 1
color = ColorGradingPass(color, texcoord);
#endif
#if USE_SCANLINES == 1
color = ScanlinesPass(color, texcoord);
#endif
#if NTSC_TV_EMULATION == 1
color = TvColorsPass(color, texcoord);
#endif
gl_FragColor = color;
}
(http://wowsatsuki.free.fr/v4/crt.jpg)I didnt even consider your fields to be worth showing off but I'm very very VERY glad to see that you stuck with it and continued to improve them again and again. Your work speaks for itself, and as someone who prefers to show rather than tell, I can offer you no higher praise.Anything worth doing is worth doing well, and doing it well often requires a metric fsck-ton of failure (https://www.youtube.com/watch?v=WlxRwGwRS4w).
Thank you again for your continued hard work and dedication, you're an inspiration.
Anything worth doing is worth doing well, and doing it well often requires a metric fsck-ton of failure (https://www.youtube.com/watch?v=WlxRwGwRS4w).
Eww, yuck. Linking that movie should be against forum policies :PFor the most part, I'd agree, but I've yet to find anything Yoda has said in any of his appearances that isn't worth remembering.
Hello, I'm starting to use this V4 upscale, but my "Cloud" in the world map or anywhere else is still a "puppet", not a better quality "person" as in the image upper in this post. Also the various berret and the rest of avalanche characters are puppets... Could you tell me why please? there is any other mod i could apply or have i just put the "char" directory in a wrong place? thanksI use the ChaOS -Character Overhaul Seven from Kaldarasha : http://forums.qhimm.com/index.php?topic=13960.0
VERY IMPORTANT : i have applied this V4 upscale mod to the 98 game, patched version, and ITA reloaded 1.1.0 mod.
I use the ChaOS -Character Overhaul Seven from Kaldarasha : http://forums.qhimm.com/index.php?topic=13960.0
Of course you can use the video and mod it as long as you credit me ^^
Could you check this version and tell me if it's ok for you: http://wowsatsuki.free.fr/Ending2.avi
I use this one (with a custom font for french version) : http://forums.qhimm.com/index.php?topic=18397.0
I use this one (with a custom font for french version) : http://forums.qhimm.com/index.php?topic=18397.0
Hmm, I can't get it to run unless I tick Compability Settings and use Win 7 or below.
But movies have no audio, and I have no sound effects, just music once the movies are done playing.
And the image is 16:9 and streched.
Any ideas?
If you don't use 7thHeaven:
You can unpack the iro's files with this tool : http://forums.qhimm.com/index.php?topic=18653.0
i just tested it and work. 7th heavens tool needs to incorporate this new iro tool.
Do I use this with Field Textures -satsuki?This release is essentially a new version of FT-sat.
there's no "optimal for all videos settings" you'll need to test but here's the process:Cool! I don't really know how to do all of that though. Do you know of any guide or tutorial perhaps to get me started? Your example looked way better!
1)extract all frame from the video to png files
2)prefilter png to reduct noise if needed (i mostly use waifu and esrgan)
3)upscale with esrgan
4)make a loseless video from pngs
5)stabilize the video with avisynth scripts (mostly temporal smoothing needed because of frame extraction / conversion)
6)compress to video with ffmpeg
7)multiplex audio from original video with compressed video
for my anime i use almost only avisynth.
here an exemple with my cat's eye bluray (done some years ago), i denoised them because too much noise in the original bluray for my taste :
http://yatoshicom.free.fr/samplecats.jpg
A step by step tutorial will be useless if you don't understand how the tools works because there's not universal settings for all vidéos, you need to undersand the tools before using them to adapt them to each video
1)ffmpeg : https://ffmpeg.org/documentation.html
2)waifu : https://github.com/lltcggie/waifu2x-caffe/releases (my tool here : http://forums.qhimm.com/index.php?topic=18798.0)
3)esrgan : https://github.com/xinntao/ESRGAN (my tool here : http://forums.qhimm.com/index.php?topic=18798.0)
4)ffmpeg (again)
5)Avisynth : http://avisynth.nl/index.php/Main_Page (a good forum for it : https://forum.doom9.org/)
6)ffmpeg (again)
7)Your choise, ffmpeg, virtualdub, mkvmerge...
hello!
using this texture pack with reunion version r06c (recently released)
might be the wrong place to ask, but with his recent update r06b(and c) my attack textures no longer function from within the base "../FINAL FANTASY VII/The_Reunion/CUSTOM/satsuki/Texture" folder. They did in r06 but not r06b/c. any idea of where i should put these or what to do to restore them? thanks
I made that change to my own install, and those textures all seem to work fine, but I'm experiencing another issue where textures in the \texture\magic\ff7\ family of subdirectories no longer seem to be working, which I've posted about (pending moderator approval) on The Reunion thread.
Hi!Hi JWK, for Reunion... Please see this post (http://forums.qhimm.com/index.php?topic=14914.msg271876#msg271876).
From The Reunion - Help.rtf:
"SEFFECT1, SEFFECT2, SEFFECT3, and RAIN7 texture files are now loaded from battle texture folder."
What this means is that rain7_00.png through seffect3_26.png, 82 files in total, need to be moved from "CUSTOM/satsuki/Texture/" to "CUSTOM/satsuki/Texture/battle/" in your case.
I made that change to my own install, and those textures all seem to work fine, but I'm experiencing another issue where textures in the \texture\magic\ff7\ family of subdirectories no longer seem to be working, which I've posted about (pending moderator approval) on The Reunion thread.
Apologies if this has been answered already but is there a guide for installing this alongside Reunion r06c? I've unpacked with IroNite but I'm really not sure what to do from this pointRead reunion manual, its all explained.
Satsuki, did you keep your work files for the upscaled video releases?Video interpolation need a realy clean source to be able to work properly or it'll show lots of artefact, ff7 video (source or upscaled) are just not clean enought to be interpoled properly.
Would it be possible to do a high-frame-rate video pack, with the video interpolated up to 30 or 60fps? I know it'll require further modding of the game to make work, but I think it might be worth the effort, especially with clips like the intro cinematic which has parts [The starfield right at the beginning] that look absolutely awful at 15fps.
Apologies if this has been answered already but is there a guide for installing this alongside Reunion r06c? I've unpacked with IroNite but I'm really not sure what to do from this pointHi demithet. For Reunion If you have still problems Please see this post (http://forums.qhimm.com/index.php?topic=14914.msg271876#msg271876).
$ sha256sum *
b7410b67ec899d2e62a32e0ea7910669f8b2ed17c147d2ee1214adf725436263 FF7.Kela51.Magics.(V1.04).iro
d50ed1689402d664b39256e0eb0f8d49aeba104d3c2fc8b1b6201054fb1a8449 FF7.SYW.Battle.(V3.17).iro
76777da2a4cc08f97c0782304888633d1332403b0e5f2b92116325c4d8eb4d7b FF7.SYW.Fields.Chars.(V4.01).iro
b0b282a6ba526b1a4f9e4019eadcbdc02275275076f9160022c16a94566ad236 FF7.SYW.Movies.(V4.01).iro
dea1a8b3f1e0919b49b52a15fdd970e3864f2490fe92fdf7498f39360a6a1422 FF7.SYW.World.(V4.10).iro
$ du -h *
1.1G FF7.Kela51.Magics.(V1.04).iro
432M FF7.SYW.Battle.(V3.17).iro
3.9G FF7.SYW.Fields.Chars.(V4.01).iro
1.6G FF7.SYW.Movies.(V4.01).iro
34M FF7.SYW.World.(V4.10).iro
I can't be sure who the author of the graphics I am using is...Never seen this bug with my texture (kela's corrected ones)
But I assume it's you :)
Certain texture animation cells have a box around them. For example the one in seffect3_19.
https://drive.google.com/file/d/1KcqxgDOksoABm9DU3LONHGCjkHNFecj7/view?usp=sharing
Does this upscale pack retain the most detail compared to other field packs? I like upscales but not at the expense of blurring details rather enhance it
All those effect are in the dfx_00.png file
No bug here.
But ff7 driver don"t deal well with alpha channel so as long as this file exists you'll have some alpha bug on world map.
If you don't want alpah channel bug, delete this file, but you'll have pixelisated world map fx instead.
Hi Satsuki,
I love this mod. I've been using it with 7th heaven 2.0 and I don't think I can ever go back to Remako.
I want to use Reunion now, which doesn't support 7h, so I've been trying to install your mod without it but I'm having issues.
I unpacked the iro file for the fields mod with Ironite like you said, and it's left me with a folder called 'Fields'. Inside that folder are two subfolders called 'Field' and 'char's, which contain all the pngs. The issue I'm having is that I have no idea where to place any of these files in order to get the game to load the mod. I tried placing the field and chars folders into Steam > steamapps > common > FINAL FANTASY VII > mods > Textures, but that didn't work. I am running the game from the FF7.exe, not through Steam or 7h.
Any advice would be appreciated, thanks.
I'm using Reunion and satsukis textures. Here's how you should set it up.
Extraxt all png's from the .iro files.
Then create a folder in The_Reunion\CUSTOM called satsuki, then a folder called texture.
Put all extracted png's in that folder.
You should get a folder structure that looks like this.
(https://i.imgur.com/ODx4lNJ.png)
Then in options.ini in the The_Reunion folder you specify satsuki (same as folder name in CUSTOM) as custom mod, like this.
(https://i.imgur.com/lDasOrA.png)
And you're set!
Can you show me what your magic folder looks like? Is there an "ff7" subfolder in there, and are you getting all textures to load correctly with Reunion? I had to move all of the seteffect files directly into the battle folder to get them to work with Reunion, which isn't the original structure from the iro files.it's right. With one of the latest update in reunion the seffect* and rain* go to battle folder. Inside texture\magic shouldbe a ff7 folder and other pngs without folder (the first is 005_00.png)
it's right. With one of the latest update in reunion the seffect* and rain* go to battle folder. Inside texture\magic shouldbe a ff7 folder and other pngs without folder (the first is 005_00.png)
it's right. With one of the latest update in reunion the seffect* and rain* go to battle folder. Inside texture\magic shouldbe a ff7 folder and other pngs without folder (the first is 005_00.png)
This tutorial for magic upscale is specifically for Reunion mod, though i hope it may be of some use to you. While using Reunion mod, this is what i do in order to get them to work correctly with reunion:
Magic textures will be read from "New_Translation" folder, and inside it, there is a "textures" folder, that's where you put "battle" and "magic" folders which are the textures you need. All of the rain, seffect, etc pngs have to be in battle folder, and a lot of subfolders (like limit, summon, spell) with a lot of pngs have to be inside "magic" folder in order to work.
(eg. rain7_00, seffect1_00)
/->battle (folder with 82 pngs)
so... it should be like this: The_Reunion -> BASE -> New_Translation -> texture ->
/->magic (folder with 8 subfolders and 1299 pngs)
(e.g: blue, limit, summon) (e.g: a1_00, a2_00)
Hope it helped. Do note, that magic textures provide some microstutters during casts, at least that's what it did for me, so you'll have 1-2 seconds freeze whenever you cast a heavy spell, especially summons.
As DLPB stated, enabling texture compression in Options.ini seem to alleviate the stuttering problem, though not completely fix it as heavy stutters seem to be present once, on the first load, after the area completely loads, stutter will be no longer present until you reach a new area.
Hope it helped :D
Edit: Oh, i didn't notice you were actually looking for help with Reunion. Then i guess, this will help you 100% since it works for me no problem.
ff7/data/battle, so battle is the folder you are looking for which has the effects inside it. Paste that battle folder into texture folder.
The same case with magic folder i believe. If it's located in ff7/data/, then move magic folder from the into textures folder.
I mean, with the permission of Satsuki, i can, perhaps, provide a zip with all the extracted files from the iro in correct directories to make it easier for you.
To use dds you need the lestest ffnx driver
Don't think it's included in reunion ATM
Here ya go BahamutSIN, uploaded the magics upscale if still needed with correct directories path. Just unzip and merge with FINAL FANTASY VII folder. Note: Intended for BASE folder.
https://www.mediafire.com/file/js8o5dug6ou8dty/FF7PC_Satsuki%27s_Magic_Pack_%28The_Reunion%29.rar/file
In some day if i found all solutions needed i'll provide a single version witch can be auto installed on reunion, or extracted for manual install (dds or png), or generate a png iro for current 7h or generate a dds iro for ffnx lasted version.
Will need some work on my side, but it'll be easyer to use ^^
I've provided satsuki with the path information too so he can create an installer for R06.
@Agravaile
Never seen this stuck, that system do you use (windows type...)
The ui upscale is for vanilla UI, if you use cutom ui or reunion ui, you'll have bugs.
Since v4 iro only minor fix, if you don't use it with ffnx to take adventage of dds... no need for update.
@Meical
If you use 7h v2 it's based on an old ffnx driver and isn't as sharp as the old aali driver i used for the screenshots.
Try to use lastest ffnx driver and you'll be as sharp as possible (https://github.com/julianxhokaxhiu/FFNx)
You need to use reunion 06 or 7h or game converter (manual install)
You can't use it on steam alone
To be honest I’m very confused with how to use this mod. I have not modded ff7 before. It looks like reunion also need ff convertor, and it seems like will install other components as well. So not sure what is the difference with manual install. Is it more recommended to use with reunion?
So install game, then ff convertor, then reunion, then ff7 syw, do I understand correctly?
To be honest I’m very confused with how to use this mod. I have not modded ff7 before. It looks like reunion also need ff convertor, and it seems like will install other components as well. So not sure what is the difference with manual install. Is it more recommended to use with reunion?No worries, it’s easier than ever.
So install game, then ff convertor, then reunion, then ff7 syw, do I understand correctly?
Replaced all links for textures with and all in one pack builder
(http://ff7syw.free.fr/fullpack.PNG)
Feel free to try ^^
Probably because of some compatibility assistant, appens sometime in windows 8/10 with vb6 apps
-Iros pack have an unique Id and name depending the options you choose, this is avoiding overwriting when creating iro with differents options and you can do individual pack for 7h without import errorThanks a lot for the quick update satsuki!
How to install on 7h 2.x
WARNING: This method is NOT SUPPORTED officially by 7h team. Please use at your own risk. DO NOT approach 7h team if something is not working properly.
Go to your 7h installation path
Go to Resources\Game Driver
Rename 7H_GameDriver.dll to _7H_GameDriver.dll
Install FFNx following instructions here: https://github.com/julianxhokaxhiu/FFNx#1998-eidos-release
Rename FFNx.dll to 7H_GameDriver.dll
Click Play and enjoy!
have you done this ? :
Could you upload a zip of the v4 in png format? Thank youYou can the provided tool and click "convert dds to png", you'll have the full structure folder in png version
here's a great shader to use with aali driver (credits to Sunwalker) :Hey satsuki, is it possible to apply this shader for Aali's drive with the steam version of FF7, or would it need to be converted to the old 98 FF7?Code: [Select]/*===============================================================================*\
(http://wowsatsuki.free.fr/v4/crt.jpg)
|####################### [FINAL FANTASY 7 SHADER FX] ########################|
|######################### By Sunwalker 21/Jan/2017 ##########################|
|| Version 1.04 ||
|| ||
|| This program is free software; you can redistribute it and/or ||
|| modify it under the terms of the GNU General Public License ||
|| as published by the Free Software Foundation; either version 2 ||
|| of the License, or (at your option) any later version. ||
|| ||
|| This program is distributed in the hope that it will be useful, ||
|| but WITHOUT ANY WARRANTY; without even the implied warranty of ||
|| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ||
|| GNU General Public License for more details. (c)2016 ||
|| ||
|#################################################################################|
\*===============================================================================*/
#version 120
//#extension GL_ARB_texture_rectangle : enable
/*------------------------------------------------------------------------------
[DEFINITIONS & ON/OFF OPTIONS]
------------------------------------------------------------------------------*/
//--------------------------#[CHOOSE EFFECTS]#--------------------------------\\
//#[ANTIALIASING TECHNIQUES] [1=ON|0=OFF] # NOTE: Enable one only
#define USE_FXAA 0 //# [0 or 1] FXAA Fast Anti-aliasing : Smoothens jagged lines using the FXAA technique.
#define USE_AABUMPMAP 0 //# Bump Map Shader with AA
//#[LIGHTING & COLOUR] [1=ON|0=OFF] # NOTE: This one can enable all
#define GAMMA_CORRECTION 1 //# RGB Gamma Correction. Fixed expansion to variable compression gamma correction curve.
#define BLENDED_BLOOM 1 //# High Quality SP Bloom. Soft lighting with blending techniques, for a natural looking bloom.
#define SCENE_TONEMAPPING 1 //# HDR Scene Tonemapping. Layered component conversion, and applies scene tone mapping.
#define COLOR_CORRECTION 1 //# Component Color Correction. Colorspace conversion, with correction curves, and multiple palette types.
#define CROSS_PROCESSING 0 //# Filmic Cross Processing. Alters the tone of the scene, crossing the game's color set, with another.
#define COLOR_GRADING 0 //# Post-Complement Colour Grading. Alters individual colour components on a scene, to enhance selected colour tones.
//#[MISC] [1=ON|0=OFF] # NOTE: Enable one only
#define USE_SCANLINES 1 //# Scanlines to simulate the look of a CRT TV. Typically suited to sprite games.
#define NTSC_TV_EMULATION 0 //# SimoneT's TV Colors Emulation Shader. Use to emulate the original PSX color space tone, and vibrancy.
/*------------------------------------------------------------------------------
[EFFECT CONFIG OPTIONS]
------------------------------------------------------------------------------*/
//##[USE_AABUMPMAP]
#define Bump 1.33 //[0.00 to 1.70] Effect strenght - lower values bring more effect
#define Glow 1.25 //[1.00 to 1.50] Max brightness on borders
#define Shde 0.75 //[0.00 to 1.00] Max darkening
#define Range 1.0 //[0.00 to 1.00] Range width
//##[GAMMA_CORRECTION]
#define Gamma 2.20 //[1.5 to 4.0] Gamma correction. Decrease for lower gamma(darker). Increase for higher gamma(brighter). (Default: 2.2)
//##[BLENDED_BLOOM]
#define BloomType BlendAddGlow //[BlendGlow, BlendAddGlow, BlendAddLight, BlendScreen, BlendLuma, BlendOverlay] The type of blended bloom. Light<->Dark.
#define BloomStrength 0.200 //[0.000 to 1.000] Overall strength of the bloom. You may want to readjust for each blend type.
#define BlendStrength 1.000 //[0.000 to 1.000] Strength of the blending. This is a modifier based on bloom. 1.0 equates to 100% strength.
#define BloomDefocus 2.000 //[1.000 to 4.000] The initial bloom defocus value. Increases the softness of light, bright objects, etc.
#define BloomWidth 3.200 //[1.000 to 8.000] Width of the bloom. Adjusts the width of the spread and soft glow. Scales with BloomStrength.
#define BloomReds 0.040 //[0.000 to 1.000] Red channel correction of the bloom. Raising will increase the bloom of reds.
#define BloomGreens 0.030 //[0.000 to 1.000] Green channel correction of the bloom. Raising will increase the bloom of greens.
#define BloomBlues 0.020 //[0.000 to 1.000] Blue channel correction of the bloom. Raising will increase the bloom of blues.
//##[SCENE_TONEMAPPING]
#define TonemapType 2 //[0|1|2|3] The base tone mapping operator. 0 is LDR, 1 is HDR(original), 2 & 3 are Filmic HDR(slight grading).
#define TonemapMask 1 //[0 or 1] Enables an ALU tone masking curve. Produces a nice cinematic look. Suits some games more than others.
#define MaskStrength 0.10 //[0.000 to 1.000] Strength of the tone masking. Higher for a stronger effect. This is a dependency of TonemapMask.
#define ToneAmount 0.360 //[0.050 to 1.000] Tonemap strength (tone correction). Higher for stronger tone mapping, lower for lighter.
#define BlackLevels 0.000 //[0.000 to 1.000] Black level balance (shadow correction). Increase to deepen blacks, lower to lighten them.
#define Exposure 1.000 //[0.100 to 2.000] White correction (brightness). Higher values for more scene exposure, lower for less.
#define Luminance 1.000 //[0.100 to 2.000] Luminance average (luminance correction). Higher values will lower scene luminance average.
#define WhitePoint 1.075 //[0.100 to 2.000] Whitepoint average (wp lum correction). Higher values will lower the maximum scene white point.
//##[COLOR_CORRECTION]
#define CorrectionPalette 1 //[1|2|3|4|5] The colorspace palette type. 1: RGB, 2: YXY, 3: XYZ, 4: HSV, 5: YUV. Each one will produce a different combination of shades & hues.
#define ChannelR 1.40 //[0.00 to 8.00] R(1), Y(2), X(3), H(4), Y(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define ChannelG 1.60 //[0.00 to 8.00] G(1), X(2), Y(3), S(4), U(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define ChannelB 1.80 //[0.00 to 8.00] B(1), Y(2), Z(3), V(4), V(5) component channel varies with the colorspace used. Higher values increase correction strength.
#define PaletteStrength 2.00 //[0.00 to 4.00] The interpolated strength ratio between the base color, and the corrected color. Raise to increase saturation.
//##[CROSS_PROCESSING]
#define FilmicProcess 1 //[1|2|3] The color conversion type for the cross process. 1: cool, 2: warm, 3: dusk. You can achieve different results with each.
#define RedShift 0.50 //[0.10 to 1.00] Red color component shift of the filmic processing. Alters the red balance of the shift.
#define GreenShift 0.50 //[0.10 to 1.00] Green color component shift of the filmic processing. Alters the green balance of the shift.
#define BlueShift 0.50 //[0.10 to 1.00] Blue color component shift of the filmic processing. Alters the blue balance of the shift.
#define ShiftRatio 0.50 //[0.10 to 2.00] The blending ratio for the base color and the color shift. Higher for a stronger effect.
//##[COLOR_GRADING]
#define RedGrading 1.20 //[0.00 to 3.00] Red colour grading coefficient. Adjust to influence the red channel coefficients of the grading, and highlight tones.
#define GreenGrading 1.10 //[0.00 to 3.00] Green colour grading coefficient. Adjust to influence the Green channel coefficients of the grading, and highlight tones.
#define BlueGrading 1.10 //[0.00 to 3.00] Blue colour grading coefficient. Adjust to influence the Blue channel coefficients of the grading, and highlight tones.
#define GradingStrength 0.25 //[0.00 to 1.00] The overall max strength of the colour grading effect. Raise to increase, lower to decrease the amount.
#define Correlation 1.00 //[0.10 to 1.00] Correlation between the base colour, and the grading influence. Lower = more of the scene is graded, Higher = less of the scene is graded.
//##[USE_SCANLINES]
#define Scanlines 0.20 //[default 0.25]
#define Brighten 0.30 //[default 0.40]
#define Colorshift 0.50 //[default 0.50]
#define Lineblur 0.50 //[default 0.50]
#define Phosphorgrid 0.00 //[default 0.20]
#define Screencurve 0.00 //[default 0.15]
#define Lines 272.0 //[default 272.0] For use with arcade conversions such as SFA3, Darkstalkers or Metal Slug. Change this to 224.0 and change PPSSPP's internal rendering resolution by 2x, to align the scanlines to the game's original arcade resolution.
#define xRES_u 1920.0 //[default 1920.0] This is the on-screen resolution of the emulation's output frame,
#define yRES_u 1088.0 //[default 1088.0] keep in mind the PSP's odd 16/9.06667 screen ratio.
//##[TEXTURE_SIZE]
#define pixelWidth 1024.0 //[1024 to 4096]
#define pixelHeight 512.0 //[512 to 2048]
#define Quality 1. //[0.5 to 1.0]
//[END OF USER OPTIONS]
/*------------------------------------------------------------------------------
[GLOBALS|FUNCTIONS]
------------------------------------------------------------------------------*/
//Global variables
#define SamplerState sampler2D
#define saturate(x) clamp(x, 0.0, 1.0)
#define lerp mix
#define frac fract
#define fmod mod
#define mul(x, y) (y * x)
#define float4x3 mat4x3
#define float3x3 mat3
#define float4x4 mat4
#define lumCoeff vec3(0.212656, 0.715158, 0.072186)
//OGL Uniforms
uniform vec4 OGLParam[4];
uniform sampler2D OGLTexture;
uniform sampler2D OGLTexture0;
//varying
uniform vec2 texcoord;
uniform vec4 color;
float Epsilon = 1e-10;
float xy = (Quality / pixelWidth, Quality / pixelHeight, Quality, 0.0);
//float y = (Quality / pixelHeight, 0.0);
vec2 OGLSize = vec2(pixelWidth, pixelHeight);
vec2 OGLInvSize = vec2(Quality / pixelWidth, Quality / pixelHeight);
//Average Relative Luminance (HSP Color Model)
//return (0.2126 * color.x) + (0.7152 * color.y) + (0.0722 * color.z);
float AvgLuminance(vec3 color)
{
return sqrt(dot(color * color, lumCoeff));
}
/*float smootherstep(float a, float b, float x)
{
x = clamp((x - a) / (b - a), 0.0, 1.0);
return x*x*x*(x*(x * 6 - 15) + 10);
}*/
//Smoothstep alt
float smootherstep(float a, float b, float x)
{
x = saturate((x - a) / (b - a));
return x*x*x*(x*(x * 6 - 15) + 10);
}
//Check for OOB rgb clipping
vec4 DebugClipping(vec4 color)
{
if (color.x >= 0.99999 && color.y >= 0.99999 &&
color.z >= 0.99999) color.xyz = vec3(1.0f, 0.0f, 0.0f);
if (color.x <= 0.00001 && color.y <= 0.00001 &&
color.z <= 0.00001) color.xyz = vec3(0.0f, 0.0f, 1.0f);
return color;
}
//Conversion matrices
vec3 RGBtoXYZ(vec3 RGB)
{
const mat3 RGBtoXYZ = mat3(
0.6068909, 0.1735011, 0.2003480,
0.2989164, 0.5865990, 0.1144845,
0.0000000, 0.0660957, 1.1162243);
return RGBtoXYZ*RGB;
}
vec3 XYZtoRGB(vec3 XYZ)
{
const mat3 XYZtoRGB = mat3(
1.9099961, -0.5324542, -0.2882091,
-0.9846663, 1.9991710, -0.0283082,
0.0583056, -0.1183781, 0.8975535);
return XYZtoRGB*XYZ;
}
vec3 XYZtoSRGB(vec3 XYZ)
{
const mat3 XYZtoSRGB = mat3(
3.2404542, -1.5371385, -0.4985314,
-0.9692660, 1.8760108, 0.0415560,
0.0556434, -0.2040259, 1.0572252);
return XYZtoSRGB*XYZ;
}
vec3 RGBtoYUV(vec3 RGB)
{
const mat3 RGBtoYUV = mat3(
0.2126, 0.7152, 0.0722,
-0.09991, -0.33609, 0.436,
0.615, -0.55861, -0.05639);
return RGBtoYUV*RGB;
}
vec3 YUVtoRGB(vec3 YUV)
{
const mat3 YUVtoRGB = mat3(
1.000, 0.000, 1.28033,
1.000, -0.21482, -0.38059,
1.000, 2.12798, 0.000);
return YUVtoRGB*YUV;
}
vec3 XYZtoYxy(vec3 XYZ)
{
float w = (XYZ.r + XYZ.g + XYZ.b);
vec3 Yxy;
Yxy.r = XYZ.g;
Yxy.g = XYZ.r / w;
Yxy.b = XYZ.g / w;
return Yxy;
}
vec3 YxytoXYZ(vec3 Yxy)
{
vec3 XYZ;
XYZ.g = Yxy.r;
XYZ.r = Yxy.r * Yxy.g / Yxy.b;
XYZ.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
return XYZ;
}
/*------------------------------------------------------------------------------
[FXAA CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
Code from http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/3/
Credit to original Author
------------------------------------------------------------------------------*/
#if USE_FXAA == 1
vec3 FxaaPixelShader(sampler2D OGLTexture, vec2 texcoord)
{
float FXAA_SPAN_MAX = 8.0; //[4.0 t0 8.0]
float FXAA_REDUCE_MUL = (1.0 / FXAA_SPAN_MAX); //[Default]
float FXAA_REDUCE_MIN = (1.0 / 128.0); //[Default]
float FXAA_SUBPIX_SHIFT = (1.0 / 4.0); //[Default]
vec4 posPos = vec4(texcoord.xy, texcoord.xy - (OGLInvSize * (0.5 + FXAA_SUBPIX_SHIFT)));
/*---------------------------------------------------------*/
vec3 rgbNW = texture2D(OGLTexture, posPos.zw, 0.0).rgb;
vec3 rgbNE = texture2D(OGLTexture, posPos.zw + vec2(1., 0.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbSW = texture2D(OGLTexture, posPos.zw + vec2(0., 1.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbSE = texture2D(OGLTexture, posPos.zw + vec2(1., 1.)*OGLInvSize.xy, 0.0).rgb;
vec3 rgbM = texture2D(OGLTexture, texcoord.xy, 0.0).rgb;
/*---------------------------------------------------------*/
//vec3 luma = vec3(0.299, 0.587, 0.114);
float lumaNW = AvgLuminance(rgbNW);
float lumaNE = AvgLuminance(rgbNE);
float lumaSW = AvgLuminance(rgbSW);
float lumaSE = AvgLuminance(rgbSE);
float lumaM = AvgLuminance(rgbM);
/*---------------------------------------------------------*/
float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
/*---------------------------------------------------------*/
vec2 dir;
dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
/*---------------------------------------------------------*/
float dirReduce = max(
(lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),
FXAA_REDUCE_MIN);
float rcpDirMin = 1.0 / (min(abs(dir.x), abs(dir.y)) + dirReduce);
dir = min(vec2(FXAA_SPAN_MAX, FXAA_SPAN_MAX),
max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),
dir * rcpDirMin)) * OGLInvSize.xy;
/*--------------------------------------------------------*/
vec3 rgbA = (1.0 / 2.0) * (
texture2D(OGLTexture, texcoord.xy + dir * (1.0 / 3.0 - 0.5)).rgb +
texture2D(OGLTexture, texcoord.xy + dir * (2.0 / 3.0 - 0.5)).rgb);
vec3 rgbB = rgbA * (1.0 / 2.0) + (1.0 / 4.0) * (
texture2D(OGLTexture, texcoord.xy + dir * (0.0 / 3.0 - 0.5)).rgb +
texture2D(OGLTexture, texcoord.xy + dir * (3.0 / 3.0 - 0.5)).rgb);
float lumaB = AvgLuminance(rgbB);
if ((lumaB < lumaMin) || (lumaB > lumaMax)) {
return rgbA.rgb;
}
else {
return rgbB.rgb;
}
}
vec4 FXAAPass(vec4 Fxaa, vec2 texcoord)
{
Fxaa.rgb = FxaaPixelShader(OGLTexture, texcoord);
Fxaa.a = AvgLuminance(Fxaa.rgb);
return Fxaa.rgb;
}
#endif
/*------------------------------------------------------------------------------
[BUMP MAPPING with AA SHADER CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
Copyright(C) 2011 - 2015 guest(r) - [email protected]
Credit to Guest r.
------------------------------------------------------------------------------*/
#if USE_AABUMPMAP == 1
vec3 BumpMapping(sampler2D OGLTexture, vec2 texcoord)
{
float x = (Range / pixelWidth);
float y = (Range / pixelHeight);
vec2 dg1 = vec2(x, y);
vec2 dg2 = vec2(-x, y);
vec2 dx = vec2(x, 0.0)*.5;
vec2 dy = vec2(0.0, y)*.5;
vec2 u_Tex0 = texcoord;
vec4 u_Tex1 = vec4(u_Tex0 - dy, u_Tex0 - dg2);
vec4 u_Tex2 = vec4(u_Tex0 + dy, u_Tex0 + dg2);
vec4 u_Tex3 = vec4(u_Tex0 - dx, u_Tex0 - dg2);
vec4 u_Tex4 = vec4(u_Tex0 + dx, u_Tex0 + dg2);
vec4 u_Tex5 = vec4(u_Tex0 - dg1, u_Tex0 - dg2);
vec4 u_Tex6 = vec4(u_Tex0 + dg1, u_Tex0 + dg2);
vec3 c10 = texture2D(OGLTexture, u_Tex1.xy).rgb;
vec3 c12 = texture2D(OGLTexture, u_Tex2.xy).rgb;
vec3 c01 = texture2D(OGLTexture, u_Tex3.xy).rgb;
vec3 c21 = texture2D(OGLTexture, u_Tex4.xy).rgb;
vec3 c00 = texture2D(OGLTexture, u_Tex5.xy).rgb;
vec3 c22 = texture2D(OGLTexture, u_Tex6.xy).rgb;
vec3 c11 = texture2D(OGLTexture, u_Tex0.xy).rgb;
vec3 c02 = texture2D(OGLTexture, u_Tex1.zw).rgb;
vec3 c20 = texture2D(OGLTexture, u_Tex2.zw).rgb;
vec3 dt = vec3(1.0, 1.0, 1.0);
float d1 = dot(abs(c00 - c22), dt) + 0.0001;
float d2 = dot(abs(c20 - c02), dt) + 0.0001;
float hl = dot(abs(c01 - c21), dt) + 0.0001;
float vl = dot(abs(c10 - c12), dt) + 0.0001;
float md = d1 + d2;
float mc = hl + vl;
hl *= md;
vl *= md;
d1 *= mc;
d2 *= mc;
float ww = d1 + d2 + hl + vl;
vec3 d11 = (hl*(c10 + c12) + vl*(c01 + c21) + d1*(c20 + c02) + d2*(c00 + c22) + ww*c11) / (3.0*ww);
c11 = (-c00 + c22 - c01 + c21 - c10 + c12 + Bump*d11) / Bump;
c11 = min(c11, Glow*d11);
c11 = max(c11, Shde*d11);
return c11;
}
vec4 BumpMappingPass(vec4 color, vec2 texcoord)
{
color.rgb = BumpMapping(OGLTexture, texcoord);
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[GAMMA CORRECTION CODE SECTION]
------------------------------------------------------------------------------*/
vec3 EncodeGamma(vec3 color, float gamma)
{
color = saturate(color);
color.r = (color.r <= 0.0404482362771082) ? color.r / 12.92 : pow((color.r + 0.055) / 1.055, gamma);
color.g = (color.g <= 0.0404482362771082) ? color.g / 12.92 : pow((color.g + 0.055) / 1.055, gamma);
color.b = (color.b <= 0.0404482362771082) ? color.b / 12.92 : pow((color.b + 0.055) / 1.055, gamma);
return color;
}
vec3 DecodeGamma(vec3 color, float gamma)
{
color = saturate(color);
color.r = (color.r <= 0.00313066844250063) ? color.r * 12.92 : 1.055 * pow(color.r, 1.0 / gamma) - 0.055;
color.g = (color.g <= 0.00313066844250063) ? color.g * 12.92 : 1.055 * pow(color.g, 1.0 / gamma) - 0.055;
color.b = (color.b <= 0.00313066844250063) ? color.b * 12.92 : 1.055 * pow(color.b, 1.0 / gamma) - 0.055;
return color;
}
#if GAMMA_CORRECTION == 1
vec4 GammaPass(vec4 color, vec2 texcoord)
{
const float GammaConst = 2.233333;
color.rgb = EncodeGamma(color.rgb, GammaConst);
color.rgb = DecodeGamma(color.rgb, float(Gamma));
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[BLENDED BLOOM CODE SECTION]
------------------------------------------------------------------------------*/
#if BLENDED_BLOOM == 1
vec3 BlendAddLight(vec3 bloom, vec3 blend)
{
return saturate(bloom + blend);
}
vec3 BlendScreen(vec3 bloom, vec3 blend)
{
return (bloom + blend) - (bloom * blend);
}
vec3 BlendGlow(vec3 bloom, vec3 blend)
{
float glow = AvgLuminance(bloom);
return lerp((bloom + blend) - (bloom * blend), (blend + blend) - (blend * blend), glow);
}
vec3 BlendAddGlow(vec3 bloom, vec3 blend)
{
float addglow = smootherstep(0.0, 1.0, AvgLuminance(bloom));
return lerp(saturate(bloom + blend), (blend + blend) - (blend * blend), addglow);
}
vec3 BlendLuma(vec3 bloom, vec3 blend)
{
float lumavg = smootherstep(0.0, 1.0, AvgLuminance(bloom + blend));
return lerp((bloom * blend), (1.0 - ((1.0 - bloom) * (1.0 - blend))), lumavg);
}
vec3 BlendOverlay(vec3 bloom, vec3 blend)
{
vec3 overlay = step(0.5, bloom);
return lerp((bloom * blend * 2.0), (1.0 - (2.0 *(1.0 - bloom) * (1.0 - blend))), overlay);
}
vec3 BloomCorrection(vec3 color)
{
vec3 bloom = color;
bloom.r = 2.0 / 3.0 * (1.0 - (bloom.r * bloom.r));
bloom.g = 2.0 / 3.0 * (1.0 - (bloom.g * bloom.g));
bloom.b = 2.0 / 3.0 * (1.0 - (bloom.b * bloom.b));
bloom.r = saturate(color.r + float(BloomReds) * bloom.r);
bloom.g = saturate(color.g + float(BloomGreens) * bloom.g);
bloom.b = saturate(color.b + float(BloomBlues) * bloom.b);
color = bloom;
return color;
}
vec4 DefocusFilter(sampler2D OGLTexture, vec2 texcoord, vec2 defocus)
{
defocus = clamp(defocus, 1.0, 1.5);
vec2 texel = OGLInvSize * defocus;
vec4 sampleA = texture2D(OGLTexture, texcoord + vec2(0.5, 0.5) * texel);
vec4 sampleB = texture2D(OGLTexture, texcoord + vec2(-0.5, 0.5) * texel);
vec4 sampleC = texture2D(OGLTexture, texcoord + vec2(0.5, -0.5) * texel);
vec4 sampleD = texture2D(OGLTexture, texcoord + vec2(-0.5, -0.5) * texel);
float fx = frac(texcoord.x * OGLSize.x);
float fy = frac(texcoord.y * OGLSize.y);
vec4 interpolateA = lerp(sampleA, sampleB, fx);
vec4 interpolateB = lerp(sampleC, sampleD, fx);
return lerp(interpolateA, interpolateB, fy);
}
vec4 BloomPass(vec4 color, vec2 texcoord)
{
float anflare = 4.0;
float width = BloomWidth;
vec2 defocus = vec2(BloomDefocus, BloomDefocus);
vec4 bloom = DefocusFilter(OGLTexture, texcoord, defocus);
vec2 dx = vec2(OGLInvSize.x * width, 0.0);
vec2 dy = vec2(0.0, OGLInvSize.y * width);
vec2 mdx = vec2(dx.x * defocus.x, 0.0);
vec2 mdy = vec2(0.0, dy.y * defocus.y);
vec4 blend = bloom * 0.22520613262190495;
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord - mdx + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - dx + mdy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + dx + mdy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord + mdx + mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - mdx + dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord - dx + dy);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord + dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord + dx + dy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + mdx + dy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord - mdx);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord - dx);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord + dx);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord + mdx);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - mdx - dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord - dx - dy);
blend += 0.100529757860782610 * texture2D(OGLTexture, texcoord - dy);
blend += 0.044875475183061630 * texture2D(OGLTexture, texcoord + dx - dy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + mdx - dy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord - mdx - mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord - dx - mdy);
blend += 0.024146616900339800 * texture2D(OGLTexture, texcoord - mdy);
blend += 0.010778807494659370 * texture2D(OGLTexture, texcoord + dx - mdy);
blend += 0.002589001911021066 * texture2D(OGLTexture, texcoord + mdx - mdy);
blend = lerp(color, blend, float(BlendStrength));
bloom.xyz = BloomType(bloom.xyz, blend.xyz);
bloom.xyz = BloomCorrection(bloom.xyz);
color.w = AvgLuminance(color.xyz);
bloom.w = AvgLuminance(bloom.xyz);
bloom.w *= anflare;
color = lerp(color, bloom, float(BloomStrength));
return color;
}
#endif
/*------------------------------------------------------------------------------
[SCENE TONE MAPPING CODE SECTION]
------------------------------------------------------------------------------*/
#if SCENE_TONEMAPPING == 1
vec3 ScaleLuminance(vec3 x)
{
float W = 1.02; // WhitePoint Scale
float L = 0.16; // Luminance Scale
float C = 1.02; // Compression Scale
float N = clamp(0.82 + ToneAmount, 1.0, 2.0);
float K = (N - L * C) / C;
vec3 tone = L * C + (1.0 - L * C) * (1.0 + K * (x - L) / ((W - L) * (W - L))) * (x - L) / (x - L + K);
vec3 color;
color.r = (x.r > L) ? tone.r : C * x.r;
color.g = (x.g > L) ? tone.g : C * x.g;
color.b = (x.b > L) ? tone.b : C * x.b;
return color;
}
vec3 TmMask(vec3 color)
{
vec3 tone = color;
float highTone = 6.2;
float greyTone = 0.4;
float midTone = 1.62;
float lowTone = 0.06;
tone.r = (tone.r * (highTone * tone.r + greyTone)) / (tone.r * (highTone * tone.r + midTone) + lowTone);
tone.g = (tone.g * (highTone * tone.g + greyTone)) / (tone.g * (highTone * tone.g + midTone) + lowTone);
tone.b = (tone.b * (highTone * tone.b + greyTone)) / (tone.b * (highTone * tone.b + midTone) + lowTone);
const float gamma = 2.42;
tone = EncodeGamma(tone, gamma);
color = lerp(color, tone, float(MaskStrength));
return color;
}
vec3 TmCurve(vec3 color)
{
vec3 T = color;
float tnamn = ToneAmount;
float blevel = length(T);
float bmask = pow(blevel, 0.02);
float A = 0.100; float B = 0.300;
float C = 0.100; float D = tnamn;
float E = 0.020; float F = 0.300;
float W = 1.000;
T.r = ((T.r*(A*T.r + C*B) + D*E) / (T.r*(A*T.r + B) + D*F)) - E / F;
T.g = ((T.g*(A*T.g + C*B) + D*E) / (T.g*(A*T.g + B) + D*F)) - E / F;
T.b = ((T.b*(A*T.b + C*B) + D*E) / (T.b*(A*T.b + B) + D*F)) - E / F;
float denom = ((W*(A*W + C*B) + D*E) / (W*(A*W + B) + D*F)) - E / F;
vec3 black = vec3(bmask, bmask, bmask);
vec3 white = vec3(denom, denom, denom);
T = T / white;
T = T * black;
color = saturate(T);
return color;
}
vec4 TonemapPass(vec4 color, vec2 texcoord)
{
float L = Luminance;
vec3 tonemap = color.rgb;
vec3 luma = vec3(L, L, L);
float blackLevel = length(tonemap);
tonemap = ScaleLuminance(tonemap);
float luminanceAverage = AvgLuminance(luma);
if (TonemapMask == 1) { tonemap = TmMask(tonemap); }
if (TonemapType == 1) { tonemap = TmCurve(tonemap); }
// RGB -> XYZ conversion
vec3 XYZ = RGBtoXYZ(tonemap);
// XYZ -> Yxy conversion
vec3 Yxy;
Yxy.r = XYZ.g; // copy luminance Y
Yxy.g = XYZ.r / (XYZ.r + XYZ.g + XYZ.b); // x = X / (X + Y + Z)
Yxy.b = XYZ.g / (XYZ.r + XYZ.g + XYZ.b); // y = Y / (X + Y + Z)
// (Wt) Tone mapped scaling of the initial wp before input modifiers
float Wt = saturate(Yxy.r / AvgLuminance(XYZ));
if (TonemapType == 2) { Yxy.r = TmCurve(Yxy).r; }
// (Lp) Map average luminance to the middlegrey zone by scaling pixel luminance
float Lp = Yxy.r * float(Exposure) / (luminanceAverage + Epsilon);
// (Wp) White point calculated, based on the toned white, and input modifier
float Wp = dot(abs(Wt), float(WhitePoint));
// (Ld) Scale all luminance within a displayable range of 0 to 1
Yxy.r = (Lp * (1.0 + Lp / (Wp * Wp))) / (1.0 + Lp);
// Yxy -> XYZ conversion
XYZ.r = Yxy.r * Yxy.g / Yxy.b; // X = Y * x / y
XYZ.g = Yxy.r; // copy luminance Y
XYZ.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; // Z = Y * (1-x-y) / y
if (TonemapType == 3) { XYZ = TmCurve(XYZ); }
// XYZ -> RGB conversion
tonemap = XYZtoRGB(XYZ);
float shadowmask = pow(saturate(blackLevel), float(BlackLevels));
tonemap = tonemap * vec3(shadowmask, shadowmask, shadowmask);
color.rgb = tonemap;
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[COLOR CORRECTION CODE SECTION]
------------------------------------------------------------------------------*/
// Converting pure hue to RGB
vec3 HUEtoRGB(float H)
{
float R = abs(H * 6.0 - 3.0) - 1.0;
float G = 2.0 - abs(H * 6.0 - 2.0);
float B = 2.0 - abs(H * 6.0 - 4.0);
return saturate(vec3(R, G, B));
}
// Converting RGB to hue/chroma/value
vec3 RGBtoHCV(vec3 RGB)
{
vec4 BG = vec4(RGB.bg, -1.0, 2.0 / 3.0);
vec4 GB = vec4(RGB.gb, 0.0, -1.0 / 3.0);
vec4 P = (RGB.g < RGB.b) ? BG : GB;
vec4 XY = vec4(P.xyw, RGB.r);
vec4 YZ = vec4(RGB.r, P.yzx);
vec4 Q = (RGB.r < P.x) ? XY : YZ;
float C = Q.x - min(Q.w, Q.y);
float H = abs((Q.w - Q.y) / (6.0 * C + Epsilon) + Q.z);
return vec3(H, C, Q.x);
}
// Converting RGB to HSV
vec3 RGBtoHSV(vec3 RGB)
{
vec3 HCV = RGBtoHCV(RGB);
float S = HCV.y / (HCV.z + Epsilon);
return vec3(HCV.x, S, HCV.z);
}
// Converting HSV to RGB
vec3 HSVtoRGB(vec3 HSV)
{
vec3 RGB = HUEtoRGB(HSV.x);
return ((RGB - 1.0) * HSV.y + 1.0) * HSV.z;
}
#if COLOR_CORRECTION == 1
// Pre correction color mask
vec3 PreCorrection(vec3 color)
{
vec3 RGB = color;
RGB.r = 2.0 / 3.0 * (1.0 - (RGB.r * RGB.r));
RGB.g = 2.0 / 3.0 * (1.0 - (RGB.g * RGB.g));
RGB.b = 2.0 / 3.0 * (1.0 - (RGB.b * RGB.b));
RGB.r = saturate(color.r + (float(ChannelR) / 200.0) * RGB.r);
RGB.g = saturate(color.g + (float(ChannelG) / 200.0) * RGB.g);
RGB.b = saturate(color.b + (float(ChannelB) / 200.0) * RGB.b);
color = saturate(RGB);
return color;
}
vec3 ColorCorrection(vec3 color)
{
float X = 1.0 / (1.0 + exp(float(ChannelR) / 2.0));
float Y = 1.0 / (1.0 + exp(float(ChannelG) / 2.0));
float Z = 1.0 / (1.0 + exp(float(ChannelB) / 2.0));
color.r = (1.0 / (1.0 + exp(float(-ChannelR) * (color.r - 0.5))) - X) / (1.0 - 2.0 * X);
color.g = (1.0 / (1.0 + exp(float(-ChannelG) * (color.g - 0.5))) - Y) / (1.0 - 2.0 * Y);
color.b = (1.0 / (1.0 + exp(float(-ChannelB) * (color.b - 0.5))) - Z) / (1.0 - 2.0 * Z);
return saturate(color);
}
vec4 CorrectionPass(vec4 color, vec2 texcoord)
{
vec3 colorspace = PreCorrection(color.rgb);
#if CorrectionPalette == 1
colorspace = ColorCorrection(colorspace);
#elif CorrectionPalette == 2
vec3 XYZ = RGBtoXYZ(colorspace);
vec3 Yxy = XYZtoYxy(XYZ);
Yxy = ColorCorrection(Yxy);
XYZ = YxytoXYZ(Yxy);
colorspace = XYZtoRGB(XYZ);
#elif CorrectionPalette == 3
vec3 XYZ = RGBtoXYZ(colorspace);
vec3 Yxy = XYZtoYxy(XYZ);
XYZ = YxytoXYZ(Yxy);
XYZ = ColorCorrection(XYZ);
colorspace = XYZtoRGB(XYZ);
#elif CorrectionPalette == 4
vec3 hsv = RGBtoHSV(colorspace);
hsv = ColorCorrection(hsv);
colorspace = HSVtoRGB(hsv);
#elif CorrectionPalette == 5
vec3 yuv = RGBtoYUV(colorspace);
yuv = ColorCorrection(yuv);
colorspace = YUVtoRGB(yuv);
#endif
color.rgb = lerp(color.rgb, colorspace, float(PaletteStrength));
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[CROSS PROCESSING CODE SECTION]
------------------------------------------------------------------------------*/
#if CROSS_PROCESSING == 1
vec3 CrossShift(vec3 color)
{
vec3 cross;
vec2 CrossMatrix[3] = vec2[](
vec2(0.960, 0.040 * color.x),
vec2(0.980, 0.020 * color.y),
vec2(0.970, 0.030 * color.z));
cross.x = float(RedShift) * CrossMatrix[0].x + CrossMatrix[0].y;
cross.y = float(GreenShift) * CrossMatrix[1].x + CrossMatrix[1].y;
cross.z = float(BlueShift) * CrossMatrix[2].x + CrossMatrix[2].y;
float lum = AvgLuminance(color);
vec3 black = vec3(0.0, 0.0, 0.0);
vec3 white = vec3(1.0, 1.0, 1.0);
cross = lerp(black, cross, saturate(lum * 2.0));
cross = lerp(cross, white, saturate(lum - 0.5) * 2.0);
color = lerp(color, cross, saturate(lum * float(ShiftRatio)));
return color;
}
vec4 CrossPass(vec4 color, vec2 texcoord)
{
#if FilmicProcess == 1
color.rgb = CrossShift(color.rgb);
#elif FilmicProcess == 2
vec3 XYZ = RGBtoXYZ(color.rgb);
vec3 Yxy = XYZtoYxy(XYZ);
Yxy = CrossShift(Yxy);
XYZ = YxytoXYZ(Yxy);
color.rgb = XYZtoRGB(XYZ);
#elif FilmicProcess == 3
vec3 XYZ = RGBtoXYZ(color.rgb);
vec3 Yxy = XYZtoYxy(XYZ);
XYZ = YxytoXYZ(Yxy);
XYZ = CrossShift(XYZ);
color.rgb = XYZtoRGB(XYZ);
#endif
color.a = AvgLuminance(color.rgb);
return saturate(color);
}
#endif
/*------------------------------------------------------------------------------
[COLOR GRADING CODE SECTION]
------------------------------------------------------------------------------*/
#if COLOR_GRADING == 1
float RGBCVtoHUE(vec3 RGB, float C, float V)
{
vec3 Delta = (V - RGB) / C;
Delta.rgb -= Delta.brg;
Delta.rgb += vec3(2.0, 4.0, 6.0);
Delta.brg = step(V, RGB) * Delta.brg;
float H;
H = max(Delta.r, max(Delta.g, Delta.b));
return frac(H / 6);
}
vec3 HSVComplement(vec3 HSV)
{
vec3 complement = HSV;
complement.x -= 0.5;
if (complement.x < 0.0) {
complement.x += 1.0;
}
return(complement);
}
float HueLerp(float h1, float h2, float v)
{
float d = abs(h1 - h2);
if (d <= 0.5)
{
return lerp(h1, h2, v);
}
else if (h1 < h2)
{
return frac(lerp((h1 + 1.0), h2, v));
}
else
{
return frac(lerp(h1, (h2 + 1.0), v));
}
}
vec4 ColorGradingPass(vec4 color, vec2 texcoord)
{
vec3 guide = vec3(RedGrading, GreenGrading, BlueGrading);
float amount = GradingStrength;
float correlation = Correlation;
float concentration = 2.00;
vec3 colorHSV = RGBtoHSV(color.rgb);
vec3 huePoleA = RGBtoHSV(guide);
vec3 huePoleB = HSVComplement(huePoleA);
float dist1 = abs(colorHSV.x - huePoleA.x);
if (dist1 > 0.5) dist1 = 1.0 - dist1;
float dist2 = abs(colorHSV.x - huePoleB.x);
if (dist2 > 0.5) dist2 = 1.0 - dist2;
float descent = smoothstep(0.0, correlation, colorHSV.y);
vec3 HSVColor = colorHSV;
if (dist1 < dist2) {
float c = descent * amount * (1.0 - pow((dist1 * 2.0), 1.0 / concentration));
HSVColor.x = HueLerp(colorHSV.x, huePoleA.x, c);
HSVColor.y = lerp(colorHSV.y, huePoleA.y, c);
}
else
{
float c = descent * amount * (1.0 - pow((dist2 * 2.0), 1.0 / concentration));
HSVColor.x = HueLerp(colorHSV.x, huePoleB.x, c);
HSVColor.y = lerp(colorHSV.y, huePoleB.y, c);
}
color.rgb = HSVtoRGB(HSVColor);
color.a = AvgLuminance(color.rgb);
return saturate(color);
}
#endif
/*------------------------------------------------------------------------------
[SCANLINES CODE SECTION]
------------------------------------------------------------------------------*/
//arcade scanlines by Nick
//Credit to Nick
//intended for use with the original PSP resolution (but works with high res too)
#if USE_SCANLINES == 1
//adjusting misc variables & stuff, no need to change these:
#define _PI 3.141592653
#define Shiftlines 0.75
#define Hblur 0.001 * Lineblur
#define Cshift 0.001 * Colorshift
#define Phosphor 1.0 - clamp(Phosphorgrid, 0.0, 1.0)
#define Darken 1.0 - clamp(Scanlines, 0.0, 1.0)
#define Scanwidthcurve Scanlines / 2.0
vec3 ArcadeScanlines(sampler2D OGLTexture, vec2 texcoord)
{
//TV screen curve:
//horizontal and vertical screen curve functions:
vec2 f = vec2(pow(texcoord.x - 0.5, 2.0) * Screencurve, pow(texcoord.y - 0.5, 2.0) * Screencurve * 0.567);
//applying and aligning functions to screen pixels:
vec2 curvedcoord = vec2(texcoord.x + (f.y - f.y * (1.5 - texcoord.x)), texcoord.y + (f.x - f.x * (1.5 - texcoord.y)));
//make the border outside the screen black instead of stretched colors:
float xborder = int(curvedcoord.x + 1.0);
float yborder = int(curvedcoord.y + 1.0);
//horizontal blur and color shift, and a sine based line sampler that stretches filtered pixels vertically
//to make them fit the scanlines better and prevent scanline bleed:
float sinsample = (sin(curvedcoord.y*Lines*2.0*_PI) + curvedcoord.y*Lines*2.0*_PI) / (Lines*2.0*_PI);
float r = (texture2D(OGLTexture, vec2(curvedcoord.x + Cshift, sinsample)).x + texture2D(OGLTexture, vec2(curvedcoord.x + Cshift + Hblur, sinsample)).x + texture2D(OGLTexture, vec2(curvedcoord.x + Cshift - Hblur, sinsample)).x) / (3.0 - Brighten);
float g = (texture2D(OGLTexture, vec2(curvedcoord.x - Cshift, sinsample)).y + texture2D(OGLTexture, vec2(curvedcoord.x - Cshift + Hblur, sinsample)).y + texture2D(OGLTexture, vec2(curvedcoord.x - Cshift - Hblur, sinsample)).y) / (3.0 - Brighten);
float b = (texture2D(OGLTexture, vec2(curvedcoord.x, sinsample)).z + texture2D(OGLTexture, vec2(curvedcoord.x + Hblur, sinsample)).z + texture2D(OGLTexture, vec2(curvedcoord.x - Hblur, sinsample)).z) / (3.0 - Brighten);
//phosphor rgb grid:
//rgb color lines:
int posr = int(texcoord.x * xRES_u + 2.0);
int posg = int(texcoord.x * xRES_u + 1.0);
int posb = int(texcoord.x * xRES_u);
float intr = mod(float(posr), 3.0);
float intg = mod(float(posg), 3.0);
float intb = mod(float(posb), 3.0);
r *= clamp(intg * intb, Phosphor, 1.0);
g *= clamp(intr * intb, Phosphor, 1.0);
b *= clamp(intr * intg, Phosphor, 1.0);
//breaks between phosphor rgb elements in a hexagonal pattern:
int yposPhosbreak1 = int(texcoord.y * yRES_u);
int yposPhosbreak2 = int(texcoord.y * yRES_u + 2.0);
int xposPhosbreak = int(texcoord.x * xRES_u / 3.0 - 0.333333333);
float intPhosbreak1 = mod(float(yposPhosbreak1), 4.0) + mod(float(xposPhosbreak), 2.0);
float intPhosbreak2 = mod(float(yposPhosbreak2), 4.0) + (1.0 - mod(float(xposPhosbreak), 2.0));
//final composition, phosphor seems to slightly redden image (?), so if it's on, we slightly mute r:
vec3 rgb = vec3(r*(0.9 + 0.1*Phosphor), g, b);
//apply phosphor breaks:
rgb *= clamp(intPhosbreak1*intPhosbreak2 + 0.5 + 0.5 * Phosphor, 0.0, 1.0);
//make scanlines:
rgb -= 1.0 - clamp(Darken + Scanwidthcurve*(1.0 + cos(Shiftlines*_PI + curvedcoord.y*_PI*2.0*Lines)), 0.0, 1.0);
//apply border:
rgb *= mod(float(xborder), 2.0)*mod(float(yborder), 2.0);
//pixel all done!
return rgb;
}
vec4 ScanlinesPass(vec4 color, vec2 texcoord)
{
color.rgb = ArcadeScanlines(OGLTexture, texcoord);
color.a = AvgLuminance(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[TV COLORS EMU CODE SECTION]
------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------
SimoneT NTSC TV colors emulation 1.0 Shader
Copyright (C) 2016 SimoneT - [email protected]
Credit to SimoneT.
------------------------------------------------------------------------------*/
#if NTSC_TV_EMULATION == 1
// conversion from NTSC RGB Reference White D65 ( color space used by NA/Japan TV's ) to XYZ
vec3 NTSC(vec3 c)
{
vec3 v = vec3(pow(c.r, 2.2), pow(c.g, 2.2), pow(c.b, 2.2)); //Inverse Companding
return v*mat3(
0.6068909, 0.1735011, 0.2003480,
0.2989164, 0.5865990, 0.1144845,
0.0000000, 0.0660957, 1.1162243);
}
// conversion from XYZ to sRGB Reference White D65 ( color space used by windows )
vec3 sRGB(vec3 c)
{
vec3 v = c*mat3(
3.2404542, -1.5371385, -0.4985314,
-0.9692660, 1.8760108, 0.0415560,
0.0556434, -0.2040259, 1.0572252);
//Companding
v.r = (v.r > 0.0031308) ? ((1.055 * pow(v.r, (1.0 / 2.4))) - 0.055) : 12.92 * v.r;
v.g = (v.g > 0.0031308) ? ((1.055 * pow(v.g, (1.0 / 2.4))) - 0.055) : 12.92 * v.g;
v.b = (v.b > 0.0031308) ? ((1.055 * pow(v.b, (1.0 / 2.4))) - 0.055) : 12.92 * v.b;
return v;
}
// NTSC RGB to sRGB
vec3 NTSCtoSRGB(vec3 c)
{
return sRGB(NTSC(c));
}
// Ported from SimoneT TV colors emulation 1.0 Shader
vec4 TvColorsPass(vec4 color, vec2 texcoord)
{
color.rgb = NTSCtoSRGB(color.rgb);
return color;
}
#endif
/*------------------------------------------------------------------------------
[MAIN() & COMBINE PASS CODE SECTION]
------------------------------------------------------------------------------*/
void main()
{
vec2 texcoord = gl_TexCoord[0].xy;
vec4 color = texture2D(OGLTexture0, texcoord);
#if USE_AABUMPMAP == 1
color = BumpMappingPass(color, texcoord);
#endif
#if USE_FXAA == 1
color = FXAAPass(color, texcoord);
#endif
#if GAMMA_CORRECTION == 1
color = GammaPass(color, texcoord);
#endif
#if BLENDED_BLOOM == 1
color = BloomPass(color, texcoord);
#endif
#if SCENE_TONEMAPPING == 1
color = TonemapPass(color, texcoord);
#endif
#if COLOR_CORRECTION == 1
color = CorrectionPass(color, texcoord);
#endif
#if CROSS_PROCESSING == 1
color = CrossPass(color, texcoord);
#endif
#if COLOR_GRADING == 1
color = ColorGradingPass(color, texcoord);
#endif
#if USE_SCANLINES == 1
color = ScanlinesPass(color, texcoord);
#endif
#if NTSC_TV_EMULATION == 1
color = TvColorsPass(color, texcoord);
#endif
gl_FragColor = color;
}
@satsuki: did you know that "Final Fantasy VII Original DVD High Quality CG Collection" and "Square 5.1ch Movie Collection" have been uploaded to the Internet Archive?
https://twitter.com/Carnivol/status/1251290281607135235?s=19
https://archive.org/details/DVDZ-9037
https://archive.org/details/SQSS-0001
These are official, DVD-format versions of the cutscenes, so maybe they can be used in a new version of the upscaled cutscenes pack?
I tried that and afterward the launcher wouldn't work at all until I renamed the files back. Been at it all night but I can't get this to work with 7H 2.0. Not sure what the issue is since I saw earlier in the thread that another guy got it working.
I used Remako for a long time, and this blows it out of the water.People keep posting this on just about every "Remako is teh pwnz0r!!" video out there, and yet....
Incredible work man. I used Remako for a long time, and this blows it out of the water. Between this, ProjectEdge and Ninostyle's FF7 models, the game looks amazing!
People keep posting this on just about every "Remako is teh pwnz0r!!" video out there, and yet....
Any difference between this installer and the links provided on 7th heaven? I have already downloaded both the mods on 7th heaven and this installer, not sure which is betterThe textures between the installer and catalog are identical. The difference is that the installer version provides the means to create DDS format textures (which can be used by the new FFNx graphics driver) and is able to generate Reunion-compatible folder structures automatically.
I tried the "Install with Reunion" option, but it didn't seem to be active when I started the game and all the relevant folders appeared to be empty.The same here.
The same here.
Reading log.txt, seems like texconv.exe (converts .dds to .png) is 64bit. My Windows is 32bit. So the program can't be run.
What a pity :(
@Panteleimon & LazarusHCWindows 7 pro 32-bit, GeForce GT 710
Witch windows version ?
Witch graphic card ?
Have you tried cpu version ?
@Panteleimon could you try this version of texconv ?That works! PNG files are appearing at the moment! Awesome work, awesome textures! Thank you!
http://ff7syw.free.fr/texconv.exe
Hi satsuki! It's been amazing replaying the game with your textures, thanks!
I wasn't sure if you saw that the DVD rip of the FFVII FMVs is downloadable from the internet archive - not sure if that would be something of use to you for future updates:
https://twitter.com/Carnivol/status/1251290281607135235
Many of those FMVs are incomplete and are only cuts from of their full versions.
The textures between the installer and catalog are identical. The difference is that the installer version provides the means to create DDS format textures (which can be used by the new FFNx graphics driver) and is able to generate Reunion-compatible folder structures automatically.can FFnx driver be used in conjunction with 7th heaven by maybe renaming the dll to fool 7th heaven to use that driver instead of its own?
How to install on 7h 2.x
WARNING: This method is NOT SUPPORTED officially by 7h team. Please use at your own risk. DO NOT approach 7h team if something is not working properly.
Go to your 7h installation path
Go to Resources\Game Driver
Rename 7H_GameDriver.dll to _7H_GameDriver.dll
Install FFNx following instructions here: https://github.com/julianxhokaxhiu/FFNx#1998-eidos-release
Rename FFNx.dll to 7H_GameDriver.dll
Click Play and enjoy!
If you use the ffnx link i provided : https://github.com/julianxhokaxhiu/FFNx
battle is 3.17, not upgraded from that time, and in my pack builder it's also 3.17ok so is up to date.
for ffnx better ask in discord
ok so is up to date.He means the FFNx channel on discord.
Asking in official discord maybe is not a good idea since they not support this method
please try this version : http://ff7syw.free.fr/farm.7zCould you upload the same corrected files, but in PNG, please? Thanks in advance!
updated packbuilder with corrected dds farm files
Could you upload the same corrected files, but in PNG, please? Thanks in advance!
i just used his installer to convert them myself, just replace the farm dds files in SYWV4 > field > farm with those he just gave and convert dds to pngI'm afraid it will take me much longer to download the whole installer again, and to convert, but that's one way to do it, so thanks anyway!
if he gives permission, i can pluck the PNGs from my files and post them
Replace Satsuki’s Movies folder you download in the first post with FFVII’s existing data -> movies folder.
Sent from my iPhone using Tapatalk
Didn't realize the Reunion mod had its own separate movie folder. Placing it there now allows the videos to play.Actually, either i am VERY wrong, though movies do WORK correctly for me, but i never used and even knew that Reunion had a separate movie folder, always dropped the movies into the default data/movies folder, and worked like a charm. Why is that then, are you using the latest Reunion release, or...?
Actually, either i am VERY wrong, though movies do WORK correctly for me, but i never used and even knew that Reunion had a separate movie folder, always dropped the movies into the default data/movies folder, and worked like a charm. Why is that then, are you using the latest Reunion release, or...?I'm using Reunion R06E so it should be the most current one. I'm not sure if this is the cause but I am using the mod "REAL Remake Modpack - Reunion Compatible Mod Mix" https://www.nexusmods.com/finalfantasy7/mods/15. For me the path is set like this FINAL FANTASY VII\The_Reunion\GLOBAL\Direct\movies there is also FINAL FANTASY VII\data\movies but nothing works in that one. So I'm not sure.
Even after you install Reunion, it says "Place movies into data/movies folder.
I have this same problems with Jusete textures. This happen randomly. Any idea what cause this problem? I have only 1gb graphic card, and 4gb ram maybe this is problem.
(https://i.imgur.com/suUK4hs.png)
you need to install a custom driver to allow mods, for exemple : https://github.com/julianxhokaxhiu/FFNxOk, I did that. Thank you for your response. Now though whenever I launch the game, regardless of resolution or full screen settings enabled, it loads in a small window that can't be enlarged or made full screen.
I edited it and saved. Still no change however.
(https://i.imgur.com/qW169In.jpg)
Don't copie, use the provider converter, you need png to use with reunion
@Gracc
There's an exe inside, if you don't have it, probably your antivirus as deleted it, some antivirus flag it as it's writing/moving/deleting files with api (false positive).
I used the reunion manual to make it the good way and as simple as possible for casual user.
If you want to do it in your own way, you can easily use the convert dds to png for manual install instead
Tested the installer with reunion R06. Everything looks perfect but it seems like the SFX texture are not loaded. For example hit particles are still pixelated. Do you know why? Installed twice and checked that the textues are copied to reunion/GLOBALHave you done a manual install or do you used "install wih reunion" option ?
Thanks for reporting but it's not artifact, it's the resize process, you can see those dots in vanilla too, but hard to see because of low resolution.
I get this error when opening the installer:
(https://i.imgur.com/Z1GqAei.png)
Does anyone know what the issue might be?
@satsuki: would it be possible to pack the program separately from the dds files when there are no changes to the dds?
That way we can avoid downloading 2+ GB every time there's a new version.
Hi Satsuki, I want to thank you for your wonderful mod to begin with. I wanted to ask you something: is it normal or a known problem that in sunken gelnika the game crash sometimes when, after defeating an enemy, reaching the battle end screen? At the beginning I thought it was Reunion's problem so I removed your mod and tried to fight some battles there but everything was fine. As soon as I installed your mod again, after 2-3 battles it crashed again.Not my mod related, but as Reuinon use png, there is memory issues with textures mods witch can crash the game or corrupt textures
@Orichalcon and ssjkakaroto
I don't kown why you would have this error, witch windows do you use ?
could you try this exe instead ?
http://ff7syw.free.fr/SYWv4installer.exe
do you mind if i add some colors for the leaves, one single color is "flat", i like your leaves but like to have 3 or 4 colors, do you alow me to mod in that way ?Do whatever you want to do)
could you try this exe instead ?Yep, this version also works for me. Thanks for the fix!
http://ff7syw.free.fr/SYWv4installer.exe
Having trouble running the installer. Keep getting a runtime error when trying to make iro files. Not very savvy with modding FF7. Any way to just download the iro files directly?Witch runtime error ?
Witch runtime error ?
This installed is done to cover all possible installation type, manual, iro pgn, iro dds, and reunion.
Too much work and trouble to update to do 1 archive for png, 1 for dds, 1 for iro dds, 1 for iro png, and 1 for reunion
could you try this exe instead ?Windows is deleting the file as quickly as I download it. All I have are malware bytes and windows defender. How do I unflag this?
http://ff7syw.free.fr/SYWv4installer.exe
this installer was a test, use the full pack instead.Got it. Managed to extract the whole thing again and use the exe by adding an exception.
if it's deleted just add it to av execeptions
Make iro from dds files, wait for the conversion. Install with reunion.
Limitation of the engine/driver, no way to fix that ATMOkeydokey, thanks for replying.
Not my mod related, but as Reuinon use png, there is memory issues with textures mods witch can crash the game or corrupt texturesis it possible to use DDS with FFNx somehow while still running Reunion?
It has an Installer program. Point the installer to the directory 7th Heaven mods are stored in (usually "<FF7 Install Path\mods\7th Heaven\").thanks for reply gonna test it out!
There should be a button labeled "create IRO using PNG". Use that, and wait. When its done, the next time you load 7th Heaven, it should be there. Activate as normal.
[00139908] [BATTLE] Entering FRAME_QUIT
[00139908] [BATTLE] endof battle.
[00139908] TRACE: *** Exception 0xc0000005, address 0x10123dc9 ***
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\7H_GameDriver.dll
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\7H_GameDriver.dll
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in E:\SteamLibrary\steamapps\common\FINAL FANTASY VII\FF7.exe
[00139908] TRACE: at new_dll_graphics_driver, address 0x10115910
[00139908] TRACE: in C:\Windows\syswow64\kernel32.dll
[00139908] TRACE: at BaseThreadInitThunk, address 0x752b343b
[00139908] TRACE: in C:\Windows\SysWOW64\ntdll.dll
[00139908] TRACE: at RtlInitializeExceptionChain, address 0x777e979f
[00139908] TRACE: in C:\Windows\SysWOW64\ntdll.dll
[00139908] TRACE: at RtlInitializeExceptionChain, address 0x777e979f
[00139908] ERROR: Unhandled Exception.
your antivirus probably blocks iti got no antivirus buddy installed and windows defender is down
winrar may very well be able to open .7z files, but have you tried using 7zip?it extract everything except the EXE file (i am using my admin account which is the only one i got in the computer)
It has an Installer program. Point the installer to the directory 7th Heaven mods are stored in (usually "<FF7 Install Path\mods\7th Heaven\").(https://i.imgur.com/gXK2osw.png)
There should be a button labeled "create IRO using PNG". Use that, and wait. When its done, the next time you load 7th Heaven, it should be there. Activate as normal.
it extract everything except the EXE file (i am using my admin account which is the only one i got in the computer)So you have a software blocking it.
could you try my mod without the "magic" part ?
because magic is realy high quality, and if you use it in png version instead of dds (with ffnx) you can get game memory overflow > crash
could you try my mod without the "magic" part ?
because magic is realy high quality, and if you use it in png version instead of dds (with ffnx) you can get game memory overflow > crash
I have a question, does anyone know if is better to make an IRO file with the DDS files (FFNX driver) OR is it better to make the IRO from PNG files?If you're using FFNx, then DDS all the way, and never look back :)
If you're using FFNx, then DDS all the way, and never look back :)
am I doing something wrong?? Or the FFNx doesn't work with certain mods???Probably the former, but FFNx absolutely HATES the 60fps mod, so if you're trying to use that combination, kill 60fps and see if things improve. If not, come join us on the discord and we'll figure out what's going wrong.
Hello, Satsuki!
Firstly, congrats on your amazing mod! It's really awesome and I'm eager to play FF7 with it!
Unfortunately, I'm having problems on activating it. I'm sorry if you answered this before, but I wasn't able to see a solution.
I followed these steps:
1) Installed FF7 (Steam)
2) Installed Reunion R06f
3) Ran SYWinstaller.4.22 (I checked every pack and selected the option "Install with The Reunion"
But when I run the game, it looks like this
https://imgur.com/g2lwFbu
Could you please, help me? I don't know what I'm doing wrong. I appreciate your attention
looks like its working from that screenshot, go to where you installed reunion and find options.ini and change "model_overhaul = n" to "model_overhaul = y" and you'll get the modded character models as well
1.- Is there a mirror for downloading this mod?? around the world, there are many countries that cannot access mega downloads.
2.- Can this mod be installed without 7th Heaven nor The Reunion nor anything like that??
https://drive.google.com/file/d/1vs0EqGMnBDhQpqPGLXrMbi9v5PgVXpzV/view?usp=sharing
https://drive.google.com/file/d/1sS62JfoPPOiMwq6Okb176MTRooTIv4lm/view?usp=sharing
https://drive.google.com/file/d/1bFQyCsQrTedDviJEdecUvvbvr7xAckYG/view?usp=sharing
https://drive.google.com/file/d/1fn13ciQKkVBRB_uAOH82BM1CFd0hMM2v/view?usp=sharing
Hi satsuki, thank you so much for the mod it looks great. However I've got one problem. I can load it alright with the Reunion mod, but everytime I open the game, being in fullscreen mode or not, the in-game screen is always oversized comparing to the windowed screen and I don't know if it's because of the Reunion configuration or not because I've tried to change it as much as I can and it's still like that.
Can you recommmend any way to fix this? Thanks!
For me it looks like a HiDPI issue.
Try right clicking your ff7 exe, Settings, Compatibility, Change high DPI settings, activate overwrite high DPI settings to application.
Save and try again.
@Ori
You seems realy agressive for no reason.
Anyone can install this pack with reunion in an easy way (just need to convert to png and read reunion's readme file)
I remove the reunion feature for some raisons and nothing to do with dlpb
-I've make the full installer from zero in c# to avoid vb6 falses positive, so i checked and optimized the code, i've removed useless feature (reunion and iro compression level)
-I removed the iro compression feature because iro's compression is only usefull for distro otherwise it'll make the use of iro slower and as iro car be 7z for distro no use here.
-I removed reunion installer because:
1)you can install it from png with copy/paste files in the reunion folders
2)i can't auto-manage file replacement, witch mean that my files will overwrithe the existing one in reunion install folder or the the renuion's one will remains and avoid my file from being used
3)as i don't use reunion myself i wont be able to do the tests needed if a bug occurs
>>So as there's no safe way to auto-install with reunion, i kept the option to convert dds to png and anyone can use use safelly the converted files with reunion
So if one day reunion provide a "safe way" i can use to make my mods work without the risk of overwriting existing installed reunion mods i'll probably get the option back.
the timing of this feature removal is suspicious, what else am i supposed to think?You're supposed to quietly ask the person who made the change, not make wild and unfounded accusations in public.
You're supposed to quietly ask the person who made the change, not make wild and unfounded accusations in public.
How are we supposed to install this mod with Reunion?