1
0
Fork 0

Urban shader: fix best quality and cleanup quality level

This commit is contained in:
Frederic Bouvier 2011-12-17 17:21:35 +01:00
parent 54f57a06d0
commit 0726910feb
2 changed files with 9 additions and 8 deletions

View file

@ -29,7 +29,7 @@
<use>/environment/terminator-relative-position-m</use>
</terminator>
<fogtype>
<use>/sim/rendering/shaders/skydome</use>
<use>/sim/rendering/scattering-shader</use>
</fogtype>
<!-- END fog include -->
@ -60,8 +60,9 @@
</and>
</or>
<or>
<extension-supported>GL_ATI_shader_texture_lod</extension-supported>
<extension-supported>GL_ARB_shader_texture_lod</extension-supported>
<extension-supported>GL_ATI_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
<extension-supported>GL_ARB_shader_texture_lod</extension-supported> <!-- not available in NVidia driver -->
<extension-supported>GL_EXT_gpu_shader4</extension-supported>
</or>
</and>
</predicate>
@ -288,7 +289,7 @@
<and>
<property>/sim/rendering/shaders/urban</property>
<less-equal>
<value type="float">2.0</value>
<value type="float">1.0</value>
<float-property>/sim/rendering/shaders/urban</float-property>
</less-equal>
<or>

View file

@ -28,8 +28,8 @@ uniform sampler2D NormalTex;
uniform sampler2D QDMTex;
uniform float depth_factor;
uniform float tile_size;
uniform float quality_level; // From /sim/rendering/quality-level
uniform float snowlevel; // From /sim/rendering/snow-level-m
uniform float quality_level;
uniform float snowlevel;
uniform vec3 night_color;
const float scale = 1.0;
@ -172,7 +172,7 @@ float ray_intersect(vec2 dp, vec2 ds)
void main (void)
{
if ( quality_level >= 3.5 ) {
if ( quality_level >= 3.0 ) {
linear_search_steps = 20;
}
vec3 ecPos3 = ecPosition.xyz / ecPosition.w;
@ -196,7 +196,7 @@ void main (void)
float shadow_factor = 1.0;
// Shadow
if ( quality_level >= 3.0 ) {
if ( quality_level >= 2.0 ) {
dp += ds * d;
vec3 sl = normalize( vec3( dot( l, VTangent ), dot( l, VBinormal ), dot( -l, VNormal ) ) );
ds = sl.xy * depth_factor / sl.z;