1
0
Fork 0

Merge branch 'master' of gitorious.org:fg/fgdata

This commit is contained in:
Gijs de Rooy 2014-07-30 12:29:50 +02:00
commit 7bbec38b0a
3 changed files with 7 additions and 5 deletions

View file

@ -50,10 +50,10 @@
<depth>
<write-mask>false</write-mask>
</depth>
<alpha-test>
<!--<alpha-test>
<comparison>gequal</comparison>
<reference type="float">0.03</reference>
</alpha-test>
</alpha-test>-->
<cull-face><use>directional</use></cull-face>
<polygon-mode>
<front>point</front>

View file

@ -7,6 +7,7 @@ uniform float avisibility;
uniform float hazeLayerAltitude;
uniform float eye_alt;
uniform float terminator;
uniform float size;
varying vec3 relPos;
varying vec2 rawPos;
@ -140,8 +141,9 @@ void main()
transmission = fog_func(transmission_arg);
float lightArg = terminator/100000.0;
float attenuationScale = 1.0 + 3.0 * (1.0 -smoothstep(-15.0, 0.0, lightArg));
float dist_att = exp(-0.3/attenuationScale/pixelSize);
float attenuationScale = 1.0 + 20.0 * (1.0 -smoothstep(-15.0, 0.0, lightArg));
//float dist_att = exp(-100.0/attenuationScale/size);
float dist_att = exp(-dist/200.0/size/attenuationScale);
//vec4 texel = texture2D(texture,gl_TexCoord[0].st);
vec4 texel = light_sprite(gl_TexCoord[0].st,transmission, noise);

View file

@ -20,7 +20,7 @@ void main()
relPos = gl_Vertex.xyz - ep.xyz;
rawPos = gl_Vertex.xy;
float dist = length(relPos);
float lightScale = size * size * size * size * size / 1000.0;
float lightScale = size * size * size * size * size/ 500.0;
pixelSize = min(size * size/25.0,lightScale/dist);
gl_PointSize = 2.0 * pixelSize;
}