1
0
Fork 0

Correct atmospheric scattering for trees, where we were applying ambient lighting twice, making them too dark, and not using an alpha test.

Also fix the tropical trees, where only half the texture was defined.
This commit is contained in:
Stuart Buchanan 2012-07-02 23:27:44 +01:00
parent 8174ea8593
commit ab21e069f7
4 changed files with 9 additions and 1 deletions

View file

@ -68,6 +68,10 @@
<source>src-alpha</source>
<destination>one-minus-src-alpha</destination>
</blend>
<alpha-test>
<comparison>gequal</comparison>
<reference type="float">0.1</reference>
</alpha-test>
<texture-unit>
<unit>0</unit>
<type>2d</type>
@ -107,6 +111,10 @@
<wrap-s>clamp</wrap-s>
<wrap-t>clamp</wrap-t>
</texture-unit>
<alpha-test>
<comparison>gequal</comparison>
<reference type="float">0.1</reference>
</alpha-test>
<program>
<vertex-shader>Shaders/tree-haze.vert</vertex-shader>
<fragment-shader>Shaders/tree-haze.frag</fragment-shader>

View file

@ -95,7 +95,7 @@ void main()
vec4 diffuse_color = gl_FrontMaterial.diffuse * max(0.1, n);
//diffuse_color.a = 1.0;
vec4 ambient_color = gl_FrontLightModelProduct.sceneColor + gl_LightSource[0].ambient * gl_FrontMaterial.ambient;
vec4 ambient_color = gl_FrontMaterial.ambient;
// here start computations for the haze layer
// we need several geometrical quantities

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB