1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-02-20 20:09:14 +00:00

Fiune tunings in frame reflections.

This commit is contained in:
Filippo Scognamiglio 2014-04-20 23:48:31 +02:00
parent 1ef94e083c
commit 40660b5ef2
2 changed files with 7 additions and 4 deletions

View File

@ -80,7 +80,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.2
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

View File

@ -19,6 +19,8 @@ ShaderEffect{
(font_color.b*0.3 + background_color.b*0.7),
1.0)
blending: true
vertexShader: "
uniform highp mat4 qt_Matrix;
uniform highp float time;
@ -64,9 +66,10 @@ ShaderEffect{
vec4 txt_normal = texture2D(normals, coords);
vec3 normal = normalize(txt_normal.rgb * 2.0 - 1.0);
vec3 light_dir = normalize(vec3(0.5,0.5, 0.0) - vec3(qt_TexCoord0, 0.0));
float reflection = dot(normal, light_dir) * 0.5 * txt_normal.a;
float reflection_alpha = (1.0 - reflection*"+frame_reflection_strength.toFixed(1)+");
vec4 dark_color = vec4(reflection_color.rgb * (reflection + 0.2) * 0.5, txt_normal.a * reflection_alpha);
float diffuse = dot(normal, light_dir);
float reflection = (diffuse * 0.6 + 0.4) * txt_normal.a;
float reflection_alpha = (1.0 - diffuse*"+frame_reflection_strength.toFixed(1)+");
vec4 dark_color = vec4(reflection_color.rgb * reflection * 0.4, txt_normal.a * reflection_alpha);
gl_FragColor = mix(dark_color, txt_color, ambient_light);
}"