aboutsummaryrefslogtreecommitdiff
path: root/shaders/satelites.frag
blob: a60502534615dfc838854f8eb9c38636a4619c6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#version 150

out vec4 frag_color ;

uniform vec3 light ;
uniform sampler2D noiseTexture ;

// normal == position ;
in vec4 position ;
in vec3 normal ;
in vec2 texMapping ;

in float rad ;
in vec3 mNormal ;
in vec4 origPos_ ;

void main() {
    float intensity = dot( normalize(vec3(position) - light), normalize(mNormal) );
    frag_color = vec4(
        mix(vec3(texture2D(noiseTexture,origPos_.xy))*intensity,
            vec3(1.0), 0.90)
        ,0.1/pow(rad,1.7)) ;
}