diff --git a/Aircraft/c172p/Models/Effects/bumpspec.eff b/Aircraft/c172p/Models/Effects/bumpspec.eff
index f3200f59b..613e4aeac 100644
--- a/Aircraft/c172p/Models/Effects/bumpspec.eff
+++ b/Aircraft/c172p/Models/Effects/bumpspec.eff
@@ -43,7 +43,7 @@
7
-
+
diff --git a/Aircraft/c172p/Models/Effects/glass.eff b/Aircraft/c172p/Models/Effects/glass.eff
index 034932b3a..cbbff718d 100644
--- a/Aircraft/c172p/Models/Effects/glass.eff
+++ b/Aircraft/c172p/Models/Effects/glass.eff
@@ -1,7 +1,7 @@
Aircraft/c172p/Models/Effects/glass
- Effects/model-combined
+ Effects/model-combined-transparent
0
0
@@ -27,109 +27,8 @@
transparent
true
- 111
+ 10
DepthSortedBin
-
-
-
- /sim/rendering/rembrandt/enabled
-
-
- 2.0
-
-
-
- GL_ARB_shader_objects
- GL_ARB_shading_language_100
- GL_ARB_vertex_shader
- GL_ARB_fragment_shader
-
-
- GL_EXT_gpu_shader4
- GL_ARB_texture_rg
-
-
-
- true
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 111
- DepthSortedBin
-
-
-
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- modulate
-
-
-
-
-
diff --git a/Docs/model-combined.eff/README.model-combined.eff b/Docs/model-combined.eff/README.model-combined.eff
index 01444ee9f..8156eeacf 100644
--- a/Docs/model-combined.eff/README.model-combined.eff
+++ b/Docs/model-combined.eff/README.model-combined.eff
@@ -8,8 +8,13 @@ The model-combined effect uses the ubershader to provide any or all of diffuse,
To use this on your aircraft model, you are advised to create a local effect that has the following lines:
+1. for automatic Rembrandt support on opaque objects use this:
my-aircraft-effect
- Effects/model-combined
+ Effects/model-combined-deferred
+
+2. for automatic Rembrandt support on transparent objects (glass) use this:
+ my-aircraft-glass-effect
+ Effects/model-combined-transparent
The only modeller-adjustable settings are those found in the parameters section and listed here. There are other entries in the parameters section, but those are for internal use only, please don't mess with them.
diff --git a/Docs/model-combined.eff/model-combined-bump.eff b/Docs/model-combined.eff/model-combined-bump.eff
index af989740e..7c99249eb 100644
--- a/Docs/model-combined.eff/model-combined-bump.eff
+++ b/Docs/model-combined.eff/model-combined-bump.eff
@@ -7,7 +7,7 @@
WARNING: do not remove the Normalmap include at the end-->
- Effects/model-combined
+ Effects/model-combined-deferred
1
@@ -77,7 +77,7 @@
7
-
+
diff --git a/Docs/model-combined.eff/model-combined-transparent.eff b/Docs/model-combined.eff/model-combined-transparent.eff
index 2ac5b553d..71a807357 100644
--- a/Docs/model-combined.eff/model-combined-transparent.eff
+++ b/Docs/model-combined.eff/model-combined-transparent.eff
@@ -7,8 +7,8 @@ Remove unnedeed settings.
WARNING: do not remove the Transparency include at the end-->
-
- Effects/model-combined
+
+ Effects/model-combined-transparent
0
@@ -83,5 +83,49 @@ WARNING: do not remove the Transparency include at the end-->
### END TRANSPARENCY INCLUDE ###
############################# -->
-
+
+
+
+
+
+ 6
+ 7
+
+
+
+
+
+
+ tangent
+ 6
+
+
+ binormal
+ 7
+
+
+
+
+
+
+
+
+
+ tangent
+ 6
+
+
+ binormal
+ 7
+
+
+
+
+
\ No newline at end of file
diff --git a/Effects/building.eff b/Effects/building.eff
index 9edc822b2..4025a9913 100644
--- a/Effects/building.eff
+++ b/Effects/building.eff
@@ -252,7 +252,7 @@
-
+
4
diff --git a/Effects/model-combined-deferred.eff b/Effects/model-combined-deferred.eff
index 43fa258a7..d098cb9ba 100644
--- a/Effects/model-combined-deferred.eff
+++ b/Effects/model-combined-deferred.eff
@@ -9,9 +9,10 @@ the objects that use it, and replaces it with the default shader.
Effects/model-combined-deferred
Effects/model-combined
-
+
+ /sim/rendering/shaders/model
/sim/rendering/rembrandt/enabled
@@ -27,33 +28,587 @@ the objects that use it, and replaces it with the default shader.
-
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ambient-and-diffuse
-
- back
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+ noise
+
+
+
+ 2
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 3
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 5
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 6
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 7
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Shaders/ubershader.vert
Shaders/ubershader-gbuffer.frag
Shaders/gbuffer-functions.frag
Shaders/gbuffer-encode.frag
-
-
+
+
+ BaseTex
+ sampler-2d
+ 0
+
+
+
+ ReflNoiseTex
+ sampler-3d
+ 1
+
+
+
+ NormalTex
+ sampler-2d
+ 2
+
+
+
+ LightMapTex
+ sampler-2d
+ 3
+
+
+
+ ReflMapTex
+ sampler-2d
+ 4
+
+
+
+ Environment
+ sampler-cube
+ 5
+
+
+
+ ReflFresnelTex
+ sampler-2d
+ 6
+
+
+
+ ReflRainbowTex
+ sampler-2d
+ 7
+
+
+
+
+
+ nmap_enabled
+ int
+
+
+
+
+
+
+
+ nmap_dds
+ int
+
+
+
+
+
+
+ nmap_tile
+ int
+
+
+
+
+
+
+
+
+ lightmap_enabled
+ int
+
+
+
+
+
+
+ lightmap_multi
+ int
+
+
+
+
+
+
+ lightmap_r_factor
+ float
+
+
+
+
+
+
+ lightmap_r_color
+ float-vec3
+
+
+
+
+
+
+ lightmap_g_factor
+ float
+
+
+
+
+
+
+ lightmap_g_color
+ float-vec3
+
+
+
+
+
+
+ lightmap_b_factor
+ float
+
+
+
+
+
+
+ lightmap_b_color
+ float-vec3
+
+
+
+
+
+
+ lightmap_a_factor
+ float
+
+
+
+
+
+
+ lightmap_a_color
+ float-vec3
+
+
+
+
+
+
+
+ refl_enabled
+ int
+
+
+
+
+
+
+ refl_correction
+ float
+
+
+
+
+
+
+
+ refl_map
+ int
+
+
+
+
+
+
+ refl_dynamic
+ int
+
+
+
+
+
+
+
+ refl_rainbow
+ float
+
+
+
+
+
+
+
+ refl_fresnel
+ float
+
+
+
+
+
+
+
+ refl_noise
+ float
+
+
+
+
+
+
+
+ dirt_enabled
+ int
+
+
+
+
+
+
+ dirt_multi
+ int
+
+
+
+
+
+
+ dirt_r_color
+ float-vec3
+
+
+
+
+
+
+ dirt_r_factor
+ float
+
+
+
+
+
+
+ dirt_g_color
+ float-vec3
+
+
+
+
+
+
+ dirt_g_factor
+ float
+
+
+
+
+
+
+ dirt_b_color
+ float-vec3
+
+
+
+
+
+
+ dirt_b_factor
+ float
+
+
+
+
+
+
+
+ amb_correction
+ float
+
+
+
+
+
+
+ shader_qual
+ int
+
+
+
+
+
+
+ hdg
+ float
+
+
+
+
+
+
+ pitch
+ float
+
+
+
+
+
+
+ roll
+ float
+
+
+
+
+
+
+
+ visibility
+ float
+
+
+
+
+
+ avisibility
+ float
+
+
+
+
+
+ hazeLayerAltitude
+ float
+
+
+
+
+
+ scattering
+ float
+
+
+
+
+
+ terminator
+ float
+
+
+
+
+
+ fogType
+ int
+
+
+
+
+
+
+ rembrandt_enabled
+ int
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Effects/model-combined-transparent.eff b/Effects/model-combined-transparent.eff
new file mode 100644
index 000000000..61fbb1b41
--- /dev/null
+++ b/Effects/model-combined-transparent.eff
@@ -0,0 +1,113 @@
+
+
+
+ Effects/model-combined-transparent
+ Effects/model-combined
+
+
+
+
+
+ /sim/rendering/shaders/model
+ 0
+
+ /sim/rendering/rembrandt/enabled
+
+
+ 2.0
+
+
+
+ GL_ARB_shader_objects
+ GL_ARB_shading_language_100
+ GL_ARB_vertex_shader
+ GL_ARB_fragment_shader
+
+
+
+
+
+ true
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 111
+ DepthSortedBin
+
+
+
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ modulate
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Effects/model-combined.eff b/Effects/model-combined.eff
index 339e33e7c..5d82d862a 100644
--- a/Effects/model-combined.eff
+++ b/Effects/model-combined.eff
@@ -173,6 +173,9 @@ please see Docs/README.model-combined.eff for documentation
true
+
+ false
+
@@ -223,12 +226,8 @@ please see Docs/README.model-combined.eff for documentation
-
-
-
-
-
-
+ 111
+ DepthSortedBin
diff --git a/Shaders/ubershader-gbuffer.frag b/Shaders/ubershader-gbuffer.frag
index e1db2e0d8..f8566e2eb 100644
--- a/Shaders/ubershader-gbuffer.frag
+++ b/Shaders/ubershader-gbuffer.frag
@@ -90,7 +90,7 @@ void main (void)
N = normalize(VNormal);
}
///END bump
- vec4 reflection = textureCube(Environment, reflVec * N);
+ vec4 reflection = textureCube(Environment, reflVec * dot(N,VNormal));
vec3 viewVec = normalize(vViewVec);
float v = abs(dot(viewVec, normalize(VNormal)));// Map a rainbowish color
vec4 fresnel = texture2D(ReflFresnelTex, vec2(v, 0.0));