mirror of
https://github.com/Swordfish90/cool-retro-term.git
synced 2025-02-22 04:49:02 +00:00
Temporarily disabled normals
This commit is contained in:
parent
03a72e39b9
commit
5076bf58b3
@ -12,7 +12,7 @@ TerminalFrame{
|
|||||||
borderTop: 116
|
borderTop: 116
|
||||||
borderBottom: 116
|
borderBottom: 116
|
||||||
imageSource: "../images/screen-frame.png"
|
imageSource: "../images/screen-frame.png"
|
||||||
normalsSource: "../images/screen-frame-normals.png"
|
//normalsSource: "../images/screen-frame-normals.png"
|
||||||
sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150)
|
sourceRect: Qt.rect(-65, -75, terminal.width + 130, terminal.height + 150)
|
||||||
|
|
||||||
shaderString: "WhiteFrameShader.qml"
|
shaderString: "WhiteFrameShader.qml"
|
||||||
|
@ -46,11 +46,11 @@ Item{
|
|||||||
sourceItem: frameimage
|
sourceItem: frameimage
|
||||||
hideSource: true
|
hideSource: true
|
||||||
}
|
}
|
||||||
ShaderEffectSource{
|
// ShaderEffectSource{
|
||||||
id: framesourcenormals
|
// id: framesourcenormals
|
||||||
sourceItem: framenormals
|
// sourceItem: framenormals
|
||||||
hideSource: true
|
// hideSource: true
|
||||||
}
|
// }
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: frameimage
|
anchors.fill: frameimage
|
||||||
source: shaderString
|
source: shaderString
|
||||||
|
@ -2,16 +2,44 @@ import QtQuick 2.1
|
|||||||
|
|
||||||
ShaderEffect{
|
ShaderEffect{
|
||||||
property variant source: framesource
|
property variant source: framesource
|
||||||
property variant normals: framesourcenormals
|
//property variant normals: framesourcenormals
|
||||||
property real screen_distorsion: shadersettings.screen_distortion
|
property real screen_distorsion: shadersettings.screen_distortion
|
||||||
property real ambient_light: shadersettings.ambient_light
|
property real ambient_light: shadersettings.ambient_light
|
||||||
property color font_color: shadersettings.font_color
|
property color font_color: shadersettings.font_color
|
||||||
property color background_color: shadersettings.background_color
|
property color background_color: shadersettings.background_color
|
||||||
property real brightness: shadercontainer.brightness
|
property real brightness: shadercontainer.brightness
|
||||||
|
|
||||||
|
// fragmentShader: "
|
||||||
|
// uniform sampler2D source;
|
||||||
|
// uniform sampler2D normals;
|
||||||
|
// uniform highp float screen_distorsion;
|
||||||
|
// uniform highp float ambient_light;
|
||||||
|
|
||||||
|
// uniform highp vec4 font_color;
|
||||||
|
// uniform highp vec4 background_color;
|
||||||
|
// uniform highp float brightness;
|
||||||
|
|
||||||
|
// varying highp vec2 qt_TexCoord0;
|
||||||
|
|
||||||
|
// vec2 distortCoordinates(vec2 coords){
|
||||||
|
// vec2 cc = coords - vec2(0.5);
|
||||||
|
// float dist = dot(cc, cc) * screen_distorsion;
|
||||||
|
// return (coords + cc * (1.0 + dist) * dist);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// void main(){
|
||||||
|
// vec2 coords = distortCoordinates(qt_TexCoord0);
|
||||||
|
// vec4 txt_color = texture2D(source, coords);
|
||||||
|
// vec4 normala = texture2D(normals, coords);
|
||||||
|
// vec3 normal = normalize(normala.rgb) * txt_color.a;
|
||||||
|
// float reflection = dot(normal, vec3(1.0, 1.0, 0.0)) * 0.4 * brightness;
|
||||||
|
// vec3 reflection_color = mix(font_color, background_color, 0.7).rgb * reflection;
|
||||||
|
// vec3 final_color = mix(txt_color.rgb, reflection_color, 1.0 - ambient_light);
|
||||||
|
// gl_FragColor = vec4(final_color, txt_color.a);
|
||||||
|
// }"
|
||||||
|
|
||||||
fragmentShader: "
|
fragmentShader: "
|
||||||
uniform sampler2D source;
|
uniform sampler2D source;
|
||||||
uniform sampler2D normals;
|
|
||||||
uniform highp float screen_distorsion;
|
uniform highp float screen_distorsion;
|
||||||
uniform highp float ambient_light;
|
uniform highp float ambient_light;
|
||||||
|
|
||||||
@ -30,10 +58,7 @@ ShaderEffect{
|
|||||||
void main(){
|
void main(){
|
||||||
vec2 coords = distortCoordinates(qt_TexCoord0);
|
vec2 coords = distortCoordinates(qt_TexCoord0);
|
||||||
vec4 txt_color = texture2D(source, coords);
|
vec4 txt_color = texture2D(source, coords);
|
||||||
vec4 normala = texture2D(normals, coords);
|
vec3 reflection_color = mix(font_color, background_color, 0.7).rgb * 0.2 * brightness;
|
||||||
vec3 normal = normalize(normala.rgb) * txt_color.a;
|
|
||||||
float reflection = dot(normal, vec3(1.0, 1.0, 0.0)) * 0.4 * brightness;
|
|
||||||
vec3 reflection_color = mix(font_color, background_color, 0.7).rgb * reflection;
|
|
||||||
vec3 final_color = mix(txt_color.rgb, reflection_color, 1.0 - ambient_light);
|
vec3 final_color = mix(txt_color.rgb, reflection_color, 1.0 - ambient_light);
|
||||||
gl_FragColor = vec4(final_color, txt_color.a);
|
gl_FragColor = vec4(final_color, txt_color.a);
|
||||||
}"
|
}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user