mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
* GLES Shaders and Vulkan Clip fallback * clip fallback: change defined name, set from engine side and invert usage * Proposed changes and fixes Fixed: -The OpenGL ES option stays on when OpenGL is off (issue #7984) -Missing precision in copy-f, volumetric-f and smaa-resolve-f -msaa-f including z-compress before precision quantification -missing float literals in volumetric-f -Fixed decals blending -Restored glBindFragDataLocation() for use in legacy external shaders -Enabled GL_ARB_explicit_attrib_location ext for GLSL version below 330 in GL -Guarded enabling/disabling of GL_CLIP_DISTANCE0_EXT and GL_DEPTH_CLAMP -Restored PI in lighting.sdr -removed "External shaders only" indication from cmakelists.txt
61 lines
1.3 KiB
Plaintext
61 lines
1.3 KiB
Plaintext
#ifdef GL_ES
|
|
precision highp float;
|
|
#endif
|
|
|
|
#ifdef VULKAN
|
|
layout(location = 0) in vec4 vertPosition;
|
|
layout(location = 1) in vec4 vertColor;
|
|
layout(location = 2) in vec4 vertTexCoord;
|
|
layout(location = 6) in float vertRadius;
|
|
|
|
layout(location = 0) out vec4 fragTexCoord;
|
|
layout(location = 1) out vec4 fragColor;
|
|
layout(location = 2) out float fragRadius;
|
|
layout(location = 3) out vec4 fragPosition;
|
|
#else
|
|
in vec4 vertPosition;
|
|
in vec4 vertTexCoord;
|
|
in vec4 vertColor;
|
|
in float vertRadius;
|
|
|
|
#ifdef FLAG_EFFECT_GEOMETRY
|
|
in vec3 vertUvec;
|
|
out vec3 geoUvec;
|
|
out float geoRadius;
|
|
out vec4 geoColor;
|
|
out float geoArrayIndex;
|
|
#else
|
|
out float fragRadius;
|
|
out vec4 fragPosition;
|
|
out vec4 fragTexCoord;
|
|
out vec4 fragColor;
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef VULKAN
|
|
layout(std140, set = 2, binding = 1)
|
|
#else
|
|
layout(std140)
|
|
#endif
|
|
uniform matrixData {
|
|
mat4 modelViewMatrix;
|
|
mat4 projMatrix;
|
|
};
|
|
|
|
void main()
|
|
{
|
|
#if !defined(VULKAN) && defined(FLAG_EFFECT_GEOMETRY)
|
|
geoRadius = vertRadius;
|
|
geoUvec = vertUvec;
|
|
gl_Position = modelViewMatrix * vertPosition;
|
|
geoColor = vertColor;
|
|
geoArrayIndex = vertTexCoord.z;
|
|
#else
|
|
fragRadius = vertRadius;
|
|
gl_Position = projMatrix * modelViewMatrix * vertPosition;
|
|
fragPosition = modelViewMatrix * vertPosition;
|
|
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
|
|
fragColor = vertColor;
|
|
#endif
|
|
}
|