Fixed some other warnings in shader. Little improvements in reflections.

This commit is contained in:
Filippo Scognamiglio
2014-04-06 17:05:00 +02:00
parent e62ee54aea
commit dc188a6e50
5 changed files with 10 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ TerminalFrame{
displacementLeft: 43.0
displacementTop: 40.0
displacementRight: 35.0
displacementBottom: 32.0
displacementBottom: 30.0
shaderString: "FrameShader.qml"
}

View File

@@ -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);
}"