Skip to content

Commit 486f11a

Browse files
authored
Merge pull request #172 from cortex-command-community/gl-postprocessing
GL Postprocessing Shaders and Settings changes
2 parents ffe351a + 74676f0 commit 486f11a

File tree

8 files changed

+148
-49
lines changed

8 files changed

+148
-49
lines changed

Data/Base.rte/GUIs/SettingsGUI.ini

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,6 @@ Name = ButtonQuickBorderless
115115
Anchor = Left, Top
116116
Text = Fullscreen
117117

118-
[ButtonQuickUpscaledBorderless]
119-
ControlType = BUTTON
120-
Parent = CollectionBoxVideoSettings
121-
X = 350
122-
Y = 29
123-
Width = 120
124-
Height = 18
125-
Visible = True
126-
Enabled = True
127-
Name = ButtonQuickUpscaledBorderless
128-
Anchor = Left, Top
129-
Text = Upscaled Fullscreen
130-
131118
[LabelResolutionSelect]
132119
ControlType = LABEL
133120
Parent = CollectionBoxVideoSettings
@@ -185,25 +172,39 @@ Anchor = Left, Top
185172
Text = Enable VSync
186173
Checked = Unchecked
187174

188-
[CheckboxIgnoreMultiDisplays]
175+
[CheckboxFullscreen]
189176
ControlType = CHECKBOX
190177
Parent = CollectionBoxVideoSettings
191178
X = 14
192179
Y = 155
193-
Width = 130
180+
Width = 85
194181
Height = 16
195182
Visible = True
196183
Enabled = True
197-
Name = CheckboxIgnoreMultiDisplays
184+
Name = CheckboxFullscreen
198185
Anchor = Left, Top
199-
Text = Ignore Multi-Displays
186+
Text = Fullscreen
187+
Checked = Unchecked
188+
189+
[CheckboxUseMultiDisplays]
190+
ControlType = CHECKBOX
191+
Parent = CollectionBoxVideoSettings
192+
X = 14
193+
Y = 175
194+
Width = 145
195+
Height = 16
196+
Visible = True
197+
Enabled = True
198+
Name = CheckboxUseMultiDisplays
199+
Anchor = Left, Top
200+
Text = Use Multiple Displays
200201
Checked = Unchecked
201202

202203
[LabelSplitscreenType]
203204
ControlType = LABEL
204205
Parent = CollectionBoxVideoSettings
205-
X = 15
206-
Y = 175
206+
X = 14
207+
Y = 195
207208
Width = 165
208209
Height = 16
209210
Visible = True
@@ -218,7 +219,7 @@ VAlignment = middle
218219
ControlType = COLLECTIONBOX
219220
Parent = CollectionBoxVideoSettings
220221
X = 190
221-
Y = 175
222+
Y = 195
222223
Width = 145
223224
Height = 15
224225
Visible = True
@@ -263,7 +264,7 @@ Parent = CollectionBoxVideoSettings
263264
X = 0
264265
Y = 75
265266
Width = 480
266-
Height = 60
267+
Height = 40
267268
Visible = True
268269
Enabled = True
269270
Name = CollectionPresetResolution
@@ -319,7 +320,7 @@ Parent = CollectionBoxVideoSettings
319320
X = 0
320321
Y = 75
321322
Width = 480
322-
Height = 60
323+
Height = 80
323324
Visible = True
324325
Enabled = True
325326
Name = CollectionCustomResolution
@@ -382,19 +383,19 @@ Enabled = True
382383
Name = TextboxCustomHeight
383384
Anchor = Left, Top
384385

385-
[CheckboxCustomUpscaled]
386-
ControlType = CHECKBOX
386+
[ComboboxResolutionMultiplier]
387+
ControlType = COMBOBOX
387388
Parent = CollectionCustomResolution
388389
X = 284
389390
Y = 11
390391
Width = 60
391392
Height = 16
392393
Visible = True
393394
Enabled = True
394-
Name = CheckboxCustomUpscaled
395+
Name = ComboboxResolutionMultiplier
395396
Anchor = Left, Top
396-
Checked = Unchecked
397-
Text = Upscaled
397+
DropHeight = 48
398+
DropDownStyle = DropDown
398399

399400
[ButtonApplyCustomResolution]
400401
ControlType = BUTTON

Data/Base.rte/GUIs/SettingsPauseGUI.ini

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,19 +115,6 @@ Name = ButtonQuickBorderless
115115
Anchor = Left, Top
116116
Text = Fullscreen
117117

118-
[ButtonQuickUpscaledBorderless]
119-
ControlType = BUTTON
120-
Parent = CollectionBoxVideoSettings
121-
X = 350
122-
Y = 29
123-
Width = 120
124-
Height = 18
125-
Visible = False
126-
Enabled = False
127-
Name = ButtonQuickUpscaledBorderless
128-
Anchor = Left, Top
129-
Text = Upscaled Fullscreen
130-
131118
[LabelResolutionSelect]
132119
ControlType = LABEL
133120
Parent = CollectionBoxVideoSettings
@@ -185,7 +172,21 @@ Anchor = Left, Top
185172
Text = Enable VSync
186173
Checked = Unchecked
187174

188-
[CheckboxIgnoreMultiDisplays]
175+
[CheckboxFullscreen]
176+
ControlType = CHECKBOX
177+
Parent = CollectionBoxVideoSettings
178+
X = 14
179+
Y = 135
180+
Width = 85
181+
Height = 16
182+
Visible = False
183+
Enabled = False
184+
Name = CheckboxFullscreen
185+
Anchor = Left, Top
186+
Text = Fullscreen
187+
Checked = Unchecked
188+
189+
[CheckboxUseMultiDisplays]
189190
ControlType = CHECKBOX
190191
Parent = CollectionBoxVideoSettings
191192
X = 14
@@ -194,9 +195,9 @@ Width = 130
194195
Height = 16
195196
Visible = False
196197
Enabled = False
197-
Name = CheckboxIgnoreMultiDisplays
198+
Name = CheckboxUseMultiDisplays
198199
Anchor = Left, Top
199-
Text = Ignore Multi-Displays
200+
Text = Use Multi-Displays
200201
Checked = Unchecked
201202

202203
[LabelSplitscreenType]
@@ -382,19 +383,20 @@ Enabled = True
382383
Name = TextboxCustomHeight
383384
Anchor = Left, Top
384385

385-
[CheckboxCustomUpscaled]
386-
ControlType = CHECKBOX
386+
[ComboboxResolutionMultiplier]
387+
ControlType = COMBOBOX
387388
Parent = CollectionCustomResolution
388389
X = 284
389390
Y = 11
390391
Width = 60
391392
Height = 16
392393
Visible = True
393394
Enabled = True
394-
Name = CheckboxCustomUpscaled
395+
Name = ComboboxResolutionMultiplier
395396
Anchor = Left, Top
396-
Checked = Unchecked
397-
Text = Upscaled
397+
Text = 2
398+
DropDownStyle = DropDown
399+
398400

399401
[ButtonApplyCustomResolution]
400402
ControlType = BUTTON
@@ -3789,4 +3791,4 @@ Enabled = True
37893791
Name = TabMiscSettings
37903792
Anchor = Left, Top
37913793
Text = Misc.
3792-
Selected = False
3794+
Selected = False

Data/Base.rte/Shaders/Blit8.frag

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//Blit8.frag
2+
#version 330 core
3+
4+
in vec2 textureUV;
5+
6+
out vec4 FragColor;
7+
8+
uniform sampler2D rteTexture;
9+
uniform sampler1D rtePalette;
10+
11+
void main()
12+
{
13+
float colorIndex = texture(rteTexture, vec2(textureUV.x, -textureUV.y)).r;
14+
FragColor = texture(rtePalette, colorIndex);
15+
}

Data/Base.rte/Shaders/Blit8.vert

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#version 330 core
2+
3+
layout (location = 0) in vec2 rteVertexPosition;
4+
layout (location = 1) in vec2 rteTexUV;
5+
6+
out vec2 textureUV;
7+
8+
uniform mat4 rteTransform;
9+
uniform mat4 rteProjection;
10+
uniform mat4 rteUVTransform;
11+
12+
void main() {
13+
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);
14+
textureUV = (rteUVTransform * vec4(rteTexUV, 0.0, 1.0)).xy;
15+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#version 330 core
2+
3+
in vec2 textureUV;
4+
5+
out vec4 FragColor;
6+
7+
uniform sampler2D rteTexture;
8+
uniform vec4 rteColor;
9+
10+
11+
void main() {
12+
FragColor = texture(rteTexture, textureUV) * rteColor;
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#version 330 core
2+
3+
layout (location = 0) in vec2 rteVertexPosition;
4+
layout (location = 1) in vec2 rteTexUV;
5+
6+
out vec2 textureUV;
7+
8+
uniform mat4 rteTransform;
9+
uniform mat4 rteProjection;
10+
11+
12+
void main() {
13+
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition, 0.0, 1.0);
14+
textureUV = rteTexUV;
15+
}

Data/Base.rte/Shaders/ScreenBlit.frag

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#version 330 core
2+
3+
in vec2 textureUV;
4+
5+
out vec4 FragColor;
6+
7+
uniform sampler2D rteTexture;
8+
uniform sampler2D rteGUITexture;
9+
10+
vec4 texture2DAA(sampler2D tex, vec2 uv) {
11+
vec2 texsize = vec2(textureSize(tex,0));
12+
vec2 uv_texspace = uv*texsize;
13+
vec2 seam = floor(uv_texspace+.5);
14+
uv_texspace = (uv_texspace-seam)/fwidth(uv_texspace)+seam;
15+
uv_texspace = clamp(uv_texspace, seam-.5, seam+.5);
16+
return texture(tex, uv_texspace/texsize);
17+
}
18+
19+
void main() {
20+
vec4 guiColor = texture2DAA(rteGUITexture, textureUV);
21+
float guiSolid = step(0.00000001, guiColor.r + guiColor.g + guiColor.b);
22+
float blendRatio = max(guiColor.a, guiSolid);
23+
FragColor = (texture2DAA(rteTexture, textureUV) * (1- blendRatio)) + guiColor * blendRatio;
24+
}

Data/Base.rte/Shaders/ScreenBlit.vert

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#version 330 core
2+
3+
layout (location = 0) in vec2 rteVertexPosition;
4+
layout (location = 1) in vec2 rteTexUV;
5+
6+
out vec2 textureUV;
7+
8+
uniform mat4 rteTransform;
9+
uniform mat4 rteProjection;
10+
11+
void main() {
12+
gl_Position = rteProjection * rteTransform * vec4(rteVertexPosition.xy, 0.0, 1.0);
13+
textureUV = rteTexUV;
14+
}

0 commit comments

Comments
 (0)