mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-01-18 12:15:27 +00:00
Fixed some other warnings in shader. Little improvements in reflections.
This commit is contained in:
parent
e62ee54aea
commit
dc188a6e50
@ -93,7 +93,7 @@ ShaderEffect {
|
||||
"qt_TexCoord0.y = -"+disp_top.toFixed(1)+"/txt_Size.y + qt_MultiTexCoord0.y / ((txt_Size.y -("+(disp_top+disp_bottom).toFixed(1)+")) / txt_Size.y);" +
|
||||
"vec2 coords = vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0*2.0)));" +
|
||||
(brightness_flickering !== 0.0 ? "
|
||||
brightness = texture2D(randomFunctionSource, coords).g * "+brightness_flickering+";"
|
||||
brightness = texture2D(randomFunctionSource, coords).g * "+brightness_flickering.toFixed(1)+";"
|
||||
: "") +
|
||||
|
||||
(horizontal_sincronization !== 0.0 ? "
|
||||
@ -193,11 +193,11 @@ ShaderEffect {
|
||||
color += randomPass(coords) * glowing_line_strength;" : "") +
|
||||
|
||||
(rasterization !== shadersettings.no_rasterization ? "
|
||||
color = mix(color, color * getScanlineIntensity(originalCoord), "+ rasterization_strength +");"
|
||||
color = mix(color, color * getScanlineIntensity(originalCoord), "+ rasterization_strength.toFixed(1) +");"
|
||||
: "") +
|
||||
|
||||
(bloom !== 0 ? "
|
||||
color += texture2D(bloomSource, coords).r *" + 2.5 * bloom + ";" : "") +
|
||||
color += texture2D(bloomSource, coords).r *" + (2.5 * bloom).toFixed(1) + ";" : "") +
|
||||
|
||||
"vec3 finalColor = mix(background_color, font_color, color).rgb;" +
|
||||
"finalColor = mix(finalColor * 1.1, vec3(0.0), 1.2 * distance * distance);" +
|
||||
@ -205,7 +205,7 @@ ShaderEffect {
|
||||
(brightness_flickering !== 0 ? "
|
||||
finalColor = mix(finalColor, vec3(0.0), brightness);" : "") +
|
||||
|
||||
"gl_FragColor = vec4(finalColor *"+brightness+", qt_Opacity);
|
||||
"gl_FragColor = vec4(finalColor *"+brightness.toFixed(1)+", qt_Opacity);
|
||||
}"
|
||||
|
||||
onStatusChanged: console.log(log) //Print warning messages
|
||||
|
@ -82,7 +82,7 @@ Item{
|
||||
property var fonts_list: fontlist
|
||||
|
||||
property bool frame_reflections: true
|
||||
property real frame_reflection_strength: ((frame_reflections && framelist.get(frames_index).reflections) ? 1.0 : 0.0) * 0.4
|
||||
property real frame_reflection_strength: ((frame_reflections && framelist.get(frames_index).reflections) ? 1.0 : 0.0) * 0.15
|
||||
|
||||
property var profiles_list: profileslist
|
||||
property int profiles_index: 0
|
||||
|
@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.0.1, 2014-04-05T12:53:24. -->
|
||||
<!-- Written by QtCreator 3.0.1, 2014-04-06T16:41:45. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
|
@ -23,7 +23,7 @@ TerminalFrame{
|
||||
displacementLeft: 43.0
|
||||
displacementTop: 40.0
|
||||
displacementRight: 35.0
|
||||
displacementBottom: 32.0
|
||||
displacementBottom: 30.0
|
||||
|
||||
shaderString: "FrameShader.qml"
|
||||
}
|
||||
|
@ -32,9 +32,9 @@ ShaderEffect{
|
||||
|
||||
void main() {
|
||||
qt_TexCoord0 = qt_MultiTexCoord0;
|
||||
brightness = "+brightness+";" +
|
||||
brightness = "+brightness.toFixed(1)+";" +
|
||||
(brightness_flickering !== 0 ?
|
||||
"brightness -= texture2D(randomFunctionSource, vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0*2.0)))).r * "+brightness_flickering+";"
|
||||
"brightness -= texture2D(randomFunctionSource, vec2(fract(time/(1024.0*2.0)), fract(time/(1024.0*1024.0*2.0)))).r * "+brightness_flickering.toFixed(1)+";"
|
||||
: "") + "
|
||||
|
||||
gl_Position = qt_Matrix * qt_Vertex;
|
||||
@ -68,7 +68,7 @@ ShaderEffect{
|
||||
float light = (reflection * 0.4 + 0.2) * brightness;
|
||||
vec3 final_color = reflection_color.rgb * light * 0.5;
|
||||
final_color += txt_color.rgb * ambient_light;
|
||||
float reflection_alpha = (1.0 - reflection*0.4);
|
||||
float reflection_alpha = (1.0 - reflection*"+frame_reflection_strength.toFixed(1)+");
|
||||
gl_FragColor = vec4(final_color * txt_normal.a, txt_color.a * qt_Opacity * reflection_alpha);
|
||||
}"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user