mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-31 02:01:19 +00:00
Made normal and rasterized images look more consisntent.
This commit is contained in:
parent
25ed5db324
commit
8fd7161ec8
@ -26,7 +26,7 @@ ShaderEffect {
|
||||
property color background_color: shadersettings.background_color
|
||||
property variant source: terminal.theSource
|
||||
property variant bloomSource: terminal.bloomSource
|
||||
property variant scanlineSource: terminal.scanlineSource
|
||||
property variant rasterizationSource: terminal.rasterizationSource
|
||||
property size txt_Size: Qt.size(frame.sourceRect.width, frame.sourceRect.height)
|
||||
property real bloom: shadersettings.bloom_strength
|
||||
|
||||
@ -96,10 +96,8 @@ ShaderEffect {
|
||||
varying highp vec2 qt_TexCoord0;
|
||||
|
||||
uniform highp vec4 font_color;
|
||||
uniform highp vec4 background_color;" +
|
||||
|
||||
(rasterization != shadersettings.no_rasterization ? "
|
||||
uniform highp sampler2D scanlineSource;" : "") +
|
||||
uniform highp vec4 background_color;
|
||||
uniform highp sampler2D rasterizationSource;" +
|
||||
|
||||
(bloom !== 0 ? "
|
||||
uniform highp sampler2D bloomSource;" : "") +
|
||||
@ -174,9 +172,7 @@ ShaderEffect {
|
||||
|
||||
"vec3 finalColor = mix(background_color, font_color, color).rgb;" +
|
||||
"finalColor = mix(finalColor * 1.1, vec3(0.0), 1.2 * distance * distance);" +
|
||||
|
||||
(rasterization != shadersettings.no_rasterization ? "
|
||||
finalColor *= texture2D(scanlineSource, coords).r;" : "") +
|
||||
"finalColor *= texture2D(rasterizationSource, coords).r;" +
|
||||
|
||||
(brightness_flickering !== 0 ? "
|
||||
finalColor *= brightness;" : "") +
|
||||
|
@ -28,10 +28,14 @@ Item{
|
||||
id: terminalContainer
|
||||
property variant theSource: finalSource
|
||||
property variant bloomSource: bloomSourceLoader.item
|
||||
property variant scanlineSource: scanlineSourceLoader.item
|
||||
property variant rasterizationSource: rasterizationEffectSource
|
||||
|
||||
property alias kterminal: kterminal
|
||||
|
||||
signal sizeChanged
|
||||
onWidthChanged: sizeChanged()
|
||||
onHeightChanged: sizeChanged()
|
||||
|
||||
//The blur effect has to take into account the framerate
|
||||
property real fpsAttenuation: 60 / shadersettings.fps
|
||||
property real mBlur: shadersettings.motion_blur
|
||||
@ -282,12 +286,10 @@ Item{
|
||||
smooth: false
|
||||
}
|
||||
}
|
||||
//Scanlines
|
||||
Loader{
|
||||
id: scanlineEffectLoader
|
||||
active: mScanlines != shadersettings.no_rasterization
|
||||
//Rasterization mask
|
||||
ShaderEffect {
|
||||
id: rasterizationEffect
|
||||
anchors.fill: parent
|
||||
sourceComponent: ShaderEffect {
|
||||
property size virtual_resolution: terminalContainer.virtual_resolution
|
||||
|
||||
fragmentShader:
|
||||
@ -297,7 +299,9 @@ Item{
|
||||
uniform highp vec2 virtual_resolution;
|
||||
|
||||
float getScanlineIntensity(vec2 coords) {
|
||||
float result = abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" +
|
||||
float result = 1.0;" +
|
||||
(mScanlines != shadersettings.no_rasterization ?
|
||||
"result *= abs(sin(coords.y * virtual_resolution.y * "+Math.PI+"));" : "") +
|
||||
(mScanlines == shadersettings.pixel_rasterization ?
|
||||
"result *= abs(sin(coords.x * virtual_resolution.x * "+Math.PI+"));" : "") + "
|
||||
return result;
|
||||
@ -307,15 +311,11 @@ Item{
|
||||
"gl_FragColor = vec4(getScanlineIntensity(qt_TexCoord0));" +
|
||||
"}"
|
||||
}
|
||||
}
|
||||
Loader{
|
||||
id: scanlineSourceLoader
|
||||
active: mScanlines != shadersettings.no_rasterization
|
||||
sourceComponent: ShaderEffectSource{
|
||||
sourceItem: scanlineEffectLoader.item
|
||||
ShaderEffectSource{
|
||||
id: rasterizationEffectSource
|
||||
sourceItem: rasterizationEffect
|
||||
sourceRect: frame.sourceRect
|
||||
hideSource: true
|
||||
smooth: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user