mirror of
				https://github.com/Swordfish90/cool-retro-term.git
				synced 2025-10-31 23:22:17 +00:00 
			
		
		
		
	Edge borders are now slightly smoother.
This commit is contained in:
		| @@ -342,10 +342,40 @@ Item{ | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     // RASTERIZATION ////////////////////////////////////////////////////////// |     // RASTERIZATION ////////////////////////////////////////////////////////// | ||||||
|  |     ShaderEffect{ | ||||||
|  |         id: rasterizationContainer | ||||||
|  |         width: frame.sourceRect.width | ||||||
|  |         height: frame.sourceRect.height | ||||||
|  |         property size offset: Qt.size(width - rasterizationEffect.width, height - rasterizationEffect.height) | ||||||
|  |         property size txtRes: Qt.size(width, height) | ||||||
|  |  | ||||||
|  |         blending: false | ||||||
|  |  | ||||||
|  |         fragmentShader: | ||||||
|  |             "uniform lowp float qt_Opacity; | ||||||
|  |              uniform highp vec2 offset; | ||||||
|  |              uniform highp vec2 txtRes;" + | ||||||
|  |  | ||||||
|  |             "varying highp vec2 qt_TexCoord0;" + | ||||||
|  |  | ||||||
|  |             "void main() {" + | ||||||
|  |                 "float color = 1.0; | ||||||
|  |                  color *= smoothstep(0.0, offset.x / txtRes.x, qt_TexCoord0.x); | ||||||
|  |                  color *= smoothstep(0.0, offset.y / txtRes.y, qt_TexCoord0.y); | ||||||
|  |                  color *= smoothstep(0.0, offset.x / txtRes.x, 1.0 - qt_TexCoord0.x); | ||||||
|  |                  color *= smoothstep(0.0, offset.y / txtRes.y, 1.0 - qt_TexCoord0.y);" + | ||||||
|  |  | ||||||
|  |                 "float distance = length(vec2(0.5) - qt_TexCoord0);" + | ||||||
|  |                 "color = mix(color, 0.0, 1.2 * distance * distance);" + | ||||||
|  |  | ||||||
|  |                 "gl_FragColor.a = color;" + | ||||||
|  |             "}" | ||||||
|  |  | ||||||
|         ShaderEffect { |         ShaderEffect { | ||||||
|             id: rasterizationEffect |             id: rasterizationEffect | ||||||
|         anchors.fill: parent |             width: terminalContainer.width | ||||||
|  |             height: terminalContainer.height | ||||||
|  |             anchors.centerIn: parent | ||||||
|             property size virtual_resolution: terminalContainer.virtual_resolution |             property size virtual_resolution: terminalContainer.virtual_resolution | ||||||
|  |  | ||||||
|             blending: false |             blending: false | ||||||
| @@ -366,18 +396,18 @@ Item{ | |||||||
|                      }" + |                      }" + | ||||||
|  |  | ||||||
|             "void main() {" + |             "void main() {" + | ||||||
|             "float distance = length(vec2(0.5) - qt_TexCoord0);" + |  | ||||||
|  |  | ||||||
|                 "float color = getScanlineIntensity(qt_TexCoord0);" + |                 "float color = getScanlineIntensity(qt_TexCoord0);" + | ||||||
|  |  | ||||||
|  |                 "float distance = length(vec2(0.5) - qt_TexCoord0);" + | ||||||
|                 "color = mix(color, 0.0, 1.2 * distance * distance);" + |                 "color = mix(color, 0.0, 1.2 * distance * distance);" + | ||||||
|  |  | ||||||
|                 "gl_FragColor.a = color;" + |                 "gl_FragColor.a = color;" + | ||||||
|             "}" |             "}" | ||||||
|         } |         } | ||||||
|  |     } | ||||||
|     ShaderEffectSource{ |     ShaderEffectSource{ | ||||||
|         id: rasterizationEffectSource |         id: rasterizationEffectSource | ||||||
|         sourceItem: rasterizationEffect |         sourceItem: rasterizationContainer | ||||||
|         sourceRect: frame.sourceRect |  | ||||||
|         hideSource: true |         hideSource: true | ||||||
|         smooth: true |         smooth: true | ||||||
|         format: ShaderEffectSource.Alpha |         format: ShaderEffectSource.Alpha | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||||
| <!DOCTYPE QtCreatorProject> | <!DOCTYPE QtCreatorProject> | ||||||
| <!-- Written by QtCreator 3.0.1, 2014-07-07T00:26:31. --> | <!-- Written by QtCreator 3.0.1, 2014-07-09T00:22:58. --> | ||||||
| <qtcreator> | <qtcreator> | ||||||
|  <data> |  <data> | ||||||
|   <variable>ProjectExplorer.Project.ActiveTarget</variable> |   <variable>ProjectExplorer.Project.ActiveTarget</variable> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user