1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00
Files
OpenRCT2/data/shaders/copyrect.vert
Matt 01b577fa58 Improve performance of panning the viewport with OpenGL renderer (#24413)
* Improve performance of panning the viewport with OpenGL renderer

* Use a shader to perform the copy rect operation

* Clear the frame buffer after its initialized

* Handle Y flip in shader, be explicit about FBO draw state

* Target 330 core, remove the y flip handling

* Explicitly use GL_RGB8 and not GL_RGB

* Add more error handling, clear depth when depth is created

* Lets try this

* Make sure blend and depth are disabled

* Bind the source fbo for reading

* Try this alternative approach

* Set read and draw buffer before glBlitFramebuffer

* Apple is forcing my hand

* Update changelog.txt
2025-05-21 18:35:05 +03:00

18 lines
374 B
GLSL

#version 330 core
in vec2 vPosition;
in vec2 vTextureCoordinate;
out vec2 fTextureCoordinate;
uniform vec4 uSourceRect;
uniform vec2 uTextureSize;
void main()
{
gl_Position = vec4(vPosition, 0.0, 1.0);
vec2 srcPos = vec2(uSourceRect.xy);
vec2 srcSize = vec2(uSourceRect.zw);
fTextureCoordinate = (srcPos + vTextureCoordinate * srcSize) / uTextureSize;
}