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 - - - - material/active - - - material/ambient - - - material/diffuse - - - material/specular - - - material/emissive - - - material/shininess - - - material/color-mode - - - - - blend/active - - - blend/source - - - blend/destination - - - - shade-model - - - cull-face - - - 111 - DepthSortedBin - - - - texture[0]/active - - 0 - - texture[0]/image - - - texture[0]/filter - - - texture[0]/wrap-s - - - texture[0]/wrap-t - - - - 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 - - - material/ambient - - - material/diffuse - - - material/specular - - - material/emissive - - - material/shininess - - ambient-and-diffuse - - back + + true + + + material/active + + + material/ambient + + + material/diffuse + + + material/specular + + + material/emissive + + + material/shininess + + + material/color-mode + + + + + blend/active + + + blend/source + + + blend/destination + + + + shade-model + + + cull-face + + + rendering-hint + + + transparent + + + transparent + + + + render-bin/bin-number + + + render-bin/bin-name + + + + + 0 + + texture[0]/image + + + texture[0]/filter + + + texture[0]/wrap-s + + + texture[0]/wrap-t + + + texture[0]/internal-format + + + + + 1 + noise + + + + 2 + + texture[2]/image + + + texture[2]/filter + + + texture[2]/wrap-s + + + texture[2]/wrap-t + + + texture[2]/internal-format + + + + + 3 + + texture[3]/image + + + texture[3]/filter + + + texture[3]/wrap-s + + + texture[3]/wrap-t + + + texture[3]/internal-format + + + + + 4 + + texture[4]/image + + + texture[4]/filter + + + texture[4]/wrap-s + + + texture[4]/wrap-t + + + texture[4]/internal-format + + + + + 5 + + texture[5]/type + + + + + + + texture[5]/images + + + + + + 6 + + texture[6]/image + + + texture[6]/filter + + + texture[6]/wrap-s + + + texture[6]/wrap-t + + + texture[6]/internal-format + + + + + 7 + + texture[7]/image + + + texture[7]/filter + + + texture[7]/wrap-s + + + texture[7]/wrap-t + + + texture[7]/internal-format + + + + + + vertex-program-two-side + + 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 + + normalmap-enabled + + + + + + nmap_dds + int + + normalmap-dds + + + + + nmap_tile + int + + normalmap-tiling + + + + + + + lightmap_enabled + int + + lightmap-enabled + + + + + lightmap_multi + int + + lightmap-multi + + + + + lightmap_r_factor + float + + lightmap-factor[0] + + + + + lightmap_r_color + float-vec3 + + lightmap-color[0] + + + + + lightmap_g_factor + float + + lightmap-factor[1] + + + + + lightmap_g_color + float-vec3 + + lightmap-color[1] + + + + + lightmap_b_factor + float + + lightmap-factor[2] + + + + + lightmap_b_color + float-vec3 + + lightmap-color[2] + + + + + lightmap_a_factor + float + + lightmap-factor[3] + + + + + lightmap_a_color + float-vec3 + + lightmap-color[3] + + + + + + refl_enabled + int + + reflection-enabled + + + + + refl_correction + float + + reflection-correction + + + + + + refl_map + int + + reflect-map-enabled + + + + + refl_dynamic + int + + reflection-dynamic + + + + + + refl_rainbow + float + + reflection-rainbow + + + + + + refl_fresnel + float + + reflection-fresnel + + + + + + refl_noise + float + + reflection-noise + + + + + + dirt_enabled + int + + dirt-enabled + + + + + dirt_multi + int + + dirt-multi + + + + + dirt_r_color + float-vec3 + + dirt-color[0] + + + + + dirt_r_factor + float + + dirt-factor[0] + + + + + dirt_g_color + float-vec3 + + dirt-color[1] + + + + + dirt_g_factor + float + + dirt-factor[1] + + + + + dirt_b_color + float-vec3 + + dirt-color[2] + + + + + dirt_b_factor + float + + dirt-factor[2] + + + + + + amb_correction + float + + ambient-correction + + + + + shader_qual + int + + shader-quality + + + + + hdg + float + + model-hdg + + + + + pitch + float + + model-pitch + + + + + roll + float + + model-roll + + + + + + visibility + float + + visibility + + + + avisibility + float + + avisibility + + + + hazeLayerAltitude + float + + lthickness + + + + scattering + float + + scattering + + + + terminator + float + + terminator + + + + fogType + int + + fogtype + + + + + rembrandt_enabled + int + + rembrandt + + + + \ 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 + + + + material/active + + + material/ambient + + + material/diffuse + + + material/specular + + + material/emissive + + + material/shininess + + + material/color-mode + + + + + blend/active + + + blend/source + + + blend/destination + + + + shade-model + + + cull-face + + + 111 + DepthSortedBin + + + + texture[0]/active + + 0 + + texture[0]/image + + + texture[0]/filter + + + texture[0]/wrap-s + + + texture[0]/wrap-t + + + + 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 + material/active @@ -223,12 +226,8 @@ please see Docs/README.model-combined.eff for documentation transparent - - render-bin/bin-number - - - render-bin/bin-name - + 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));