Sync of all the shaders from upstream + LoadFontData did not match anymore with C and crashed on MacOS
This commit is contained in:
parent
21d83c60a9
commit
7cd46c491f
82 changed files with 767 additions and 753 deletions
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
uniform vec2 resolution = vec2(800, 450);
|
||||
|
||||
void main()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ uniform mat4 mvp;
|
|||
varying vec2 fragTexCoord;
|
||||
varying vec4 fragColor;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
const vec2 size = vec2(800, 450); // Framebuffer size
|
||||
const float samples = 5.0; // Pixels per axis; higher = bigger glow, worse performance
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
// NOTE: Render size values must be passed from code
|
||||
const float renderWidth = 800.0;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
float hatchOffsetY = 5.0;
|
||||
float lumThreshold01 = 0.9;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
// NOTE: Render size values must be passed from code
|
||||
const float renderWidth = 800.0;
|
||||
|
|
@ -21,8 +21,8 @@ vec4 PostFX(sampler2D tex, vec2 uv)
|
|||
{
|
||||
vec4 c = vec4(0.0);
|
||||
float size = stitchingSize;
|
||||
vec2 cPos = uv * vec2(renderWidth, renderHeight);
|
||||
vec2 tlPos = floor(cPos / vec2(size, size));
|
||||
vec2 cPos = uv*vec2(renderWidth, renderHeight);
|
||||
vec2 tlPos = floor(cPos/vec2(size, size));
|
||||
tlPos *= size;
|
||||
|
||||
int remX = int(mod(cPos.x, size));
|
||||
|
|
@ -36,11 +36,11 @@ vec4 PostFX(sampler2D tex, vec2 uv)
|
|||
if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y)))))
|
||||
{
|
||||
if (invert == 1) c = vec4(0.2, 0.15, 0.05, 1.0);
|
||||
else c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
|
||||
else c = texture2D(tex, tlPos*vec2(1.0/renderWidth, 1.0/renderHeight))*1.4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (invert == 1) c = texture2D(tex, tlPos * vec2(1.0/renderWidth, 1.0/renderHeight)) * 1.4;
|
||||
if (invert == 1) c = texture2D(tex, tlPos*vec2(1.0/renderWidth, 1.0/renderHeight))*1.4;
|
||||
else c = vec4(0.0, 0.0, 0.0, 1.0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
@ -32,4 +32,4 @@ void main()
|
|||
color = color/9.5;
|
||||
|
||||
gl_FragColor = color;
|
||||
}
|
||||
}
|
||||
|
|
@ -8,29 +8,29 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
const float PI = 3.1415926535;
|
||||
|
||||
void main()
|
||||
{
|
||||
float aperture = 178.0;
|
||||
float apertureHalf = 0.5 * aperture * (PI / 180.0);
|
||||
float apertureHalf = 0.5*aperture*(PI/180.0);
|
||||
float maxFactor = sin(apertureHalf);
|
||||
|
||||
vec2 uv = vec2(0.0);
|
||||
vec2 xy = 2.0 * fragTexCoord.xy - 1.0;
|
||||
vec2 xy = 2.0*fragTexCoord.xy - 1.0;
|
||||
float d = length(xy);
|
||||
|
||||
if (d < (2.0 - maxFactor))
|
||||
{
|
||||
d = length(xy * maxFactor);
|
||||
float z = sqrt(1.0 - d * d);
|
||||
float r = atan(d, z) / PI;
|
||||
d = length(xy*maxFactor);
|
||||
float z = sqrt(1.0 - d*d);
|
||||
float r = atan(d, z)/PI;
|
||||
float phi = atan(xy.y, xy.x);
|
||||
|
||||
uv.x = r * cos(phi) + 0.5;
|
||||
uv.y = r * sin(phi) + 0.5;
|
||||
uv.x = r*cos(phi) + 0.5;
|
||||
uv.y = r*sin(phi) + 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ varying vec3 fragNormal;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
#define MAX_LIGHTS 4
|
||||
#define LIGHT_DIRECTIONAL 0
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,18 +10,12 @@ varying vec3 fragNormal;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
#define MAX_LIGHTS 4
|
||||
#define LIGHT_DIRECTIONAL 0
|
||||
#define LIGHT_POINT 1
|
||||
|
||||
struct MaterialProperty {
|
||||
vec3 color;
|
||||
int useSampler;
|
||||
sampler2D sampler;
|
||||
};
|
||||
|
||||
struct Light {
|
||||
int enabled;
|
||||
int type;
|
||||
|
|
@ -44,6 +38,8 @@ void main()
|
|||
vec3 viewD = normalize(viewPos - fragPosition);
|
||||
vec3 specular = vec3(0.0);
|
||||
|
||||
vec4 tint = colDiffuse*fragColor;
|
||||
|
||||
// NOTE: Implement here your fragment shader code
|
||||
|
||||
for (int i = 0; i < MAX_LIGHTS; i++)
|
||||
|
|
@ -71,7 +67,7 @@ void main()
|
|||
}
|
||||
}
|
||||
|
||||
vec4 finalColor = (texelColor*((colDiffuse + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
vec4 finalColor = (texelColor*((tint + vec4(specular, 1.0))*vec4(lightDot, 1.0)));
|
||||
finalColor += texelColor*(ambient/10.0);
|
||||
|
||||
// Gamma correction
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ varying vec2 fragTexCoord;
|
|||
varying vec4 fragColor;
|
||||
varying vec3 fragNormal;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
// https://github.com/glslify/glsl-inverse
|
||||
mat3 inverse(mat3 m)
|
||||
|
|
|
|||
|
|
@ -13,15 +13,15 @@ uniform ivec3 palette[colors];
|
|||
void main()
|
||||
{
|
||||
// Texel color fetching from texture sampler
|
||||
vec4 texelColor = texture(texture0, fragTexCoord) * fragColor;
|
||||
vec4 texelColor = texture(texture0, fragTexCoord)*fragColor;
|
||||
|
||||
// Convert the (normalized) texel color RED component (GB would work, too)
|
||||
// to the palette index by scaling up from [0, 1] to [0, 255].
|
||||
int index = int(texelColor.r * 255.0);
|
||||
// to the palette index by scaling up from [0, 1] to [0, 255]
|
||||
int index = int(texelColor.r*255.0);
|
||||
ivec3 color = palette[index];
|
||||
|
||||
// Calculate final fragment color. Note that the palette color components
|
||||
// are defined in the range [0, 255] and need to be normalized to [0, 1]
|
||||
// for OpenGL to work.
|
||||
gl_FragColor = vec4(color / 255.0, texelColor.a);
|
||||
// for OpenGL to work
|
||||
gl_FragColor = vec4(color/255.0, texelColor.a);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
// NOTE: Render size values must be passed from code
|
||||
const float renderWidth = 800.0;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
float gamma = 0.6;
|
||||
float numColors = 8.0;
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
void main()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
float offset = 0.0;
|
||||
float frequency = 450.0/3.0;
|
||||
|
|
@ -33,7 +33,7 @@ void main()
|
|||
fragColor = color;
|
||||
*/
|
||||
// Scanlines method 2
|
||||
float globalPos = (fragTexCoord.y + offset) * frequency;
|
||||
float globalPos = (fragTexCoord.y + offset)*frequency;
|
||||
float wavePos = cos((fract(globalPos) - 0.5)*3.14);
|
||||
|
||||
vec4 color = texture2D(texture0, fragTexCoord);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
vec2 resolution = vec2(800.0, 450.0);
|
||||
|
||||
void main()
|
||||
|
|
@ -18,10 +18,10 @@ void main()
|
|||
|
||||
vec4 horizEdge = vec4(0.0);
|
||||
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y - y))*1.0;
|
||||
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
|
||||
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y ))*2.0;
|
||||
horizEdge -= texture2D(texture0, vec2(fragTexCoord.x - x, fragTexCoord.y + y))*1.0;
|
||||
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y - y))*1.0;
|
||||
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
|
||||
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y ))*2.0;
|
||||
horizEdge += texture2D(texture0, vec2(fragTexCoord.x + x, fragTexCoord.y + y))*1.0;
|
||||
|
||||
vec4 vertEdge = vec4(0.0);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ varying vec4 fragColor;
|
|||
uniform sampler2D texture0;
|
||||
uniform vec4 colDiffuse;
|
||||
|
||||
// NOTE: Add here your custom variables
|
||||
// NOTE: Add your custom variables here
|
||||
|
||||
// NOTE: Render size values should be passed from code
|
||||
const float renderWidth = 800;
|
||||
|
|
|
|||
Loading…
Reference in a new issue