mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Fix OpenGL scaling and improve performance
This commit is contained in:
21
AerofoilSDL/ShaderCode/CopyQuadP.cpp
Normal file
21
AerofoilSDL/ShaderCode/CopyQuadP.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "Functions.h"
|
||||
|
||||
#define GP_GL_SHADER_CODE_COPYQUADP_GLSL "uniform sampler2D surfaceTexture;\n"\
|
||||
"varying vec4 texCoord;\n"\
|
||||
"\n"\
|
||||
"uniform vec4 dxdy_dimensions;\n"\
|
||||
"\n"\
|
||||
"vec3 SamplePixel(vec2 coord)\n"\
|
||||
"{\n"\
|
||||
" return texture2D(surfaceTexture, (coord + vec2(0.5, 0.5)) / dxdy_dimensions.zw).rgb;\n"\
|
||||
"}\n"\
|
||||
"\n"\
|
||||
"void main()\n"\
|
||||
"{\n"\
|
||||
" gl_FragColor = vec4(LinearToSRGB(texture2D(surfaceTexture, texCoord.xy).rgb), 1.0);\n"\
|
||||
"}\n"
|
||||
|
||||
namespace GpBinarizedShaders
|
||||
{
|
||||
const char *g_copyQuadP_GL2 = GP_GL_SHADER_CODE_PRECISION_PREFIX GP_GL_SHADER_CODE_FUNCTIONS_H GP_GL_SHADER_CODE_COPYQUADP_GLSL;
|
||||
}
|
Reference in New Issue
Block a user