Remove intermediate quality settings from the ubershader. Fix a texture.
This commit is contained in:
parent
830f8dacee
commit
7f183e0117
10 changed files with 128 additions and 159 deletions
Binary file not shown.
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -93,9 +93,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
|
@ -120,9 +120,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
|
@ -142,9 +142,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
|
@ -164,9 +164,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
|
@ -201,9 +201,9 @@ the objects that use it, and replaces it with the default shader.
|
|||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
|
@ -218,7 +218,7 @@ the objects that use it, and replaces it with the default shader.
|
|||
</internal-format>
|
||||
</texture-unit>
|
||||
<!-- Reflection rainbow texture unit-->
|
||||
<!-- <texture-unit>
|
||||
<!-- <texture-unit>
|
||||
<unit>7</unit>
|
||||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
|
@ -235,7 +235,7 @@ the objects that use it, and replaces it with the default shader.
|
|||
<internal-format>
|
||||
<use>texture[7]/internal-format</use>
|
||||
</internal-format>
|
||||
</texture-unit>-->
|
||||
</texture-unit>-->
|
||||
|
||||
|
||||
<vertex-program-two-side>
|
||||
|
@ -285,7 +285,7 @@ the objects that use it, and replaces it with the default shader.
|
|||
<value type="int">5</value>
|
||||
</uniform>
|
||||
|
||||
<!-- <uniform>
|
||||
<!-- <uniform>
|
||||
<name>ReflFresnelTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
|
@ -295,12 +295,12 @@ the objects that use it, and replaces it with the default shader.
|
|||
<name>ReflRainbowTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">7</value>
|
||||
</uniform>-->
|
||||
|
||||
<uniform>
|
||||
<name>ReflGradientsTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>-->
|
||||
|
||||
<uniform>
|
||||
<name>ReflGradientsTex</name>
|
||||
<type>sampler-2d</type>
|
||||
<value type="int">6</value>
|
||||
</uniform>
|
||||
|
||||
<!-- NORMAL MAP -->
|
||||
|
@ -546,14 +546,6 @@ the objects that use it, and replaces it with the default shader.
|
|||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
|
|
|
@ -79,13 +79,13 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<bin-name>DepthSortedBin</bin-name>
|
||||
</render-bin>
|
||||
<texture-unit>
|
||||
<unit>0</unit>
|
||||
<unit>0</unit>
|
||||
<active>
|
||||
<use>texture[0]/active</use>
|
||||
</active>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
|
@ -198,9 +198,9 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
|
@ -225,9 +225,9 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
|
@ -247,9 +247,9 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
|
@ -269,9 +269,9 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
|
@ -308,9 +308,9 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
|
@ -629,14 +629,6 @@ and fallback to plain transparency when the model shader is disabled.
|
|||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
|
|
|
@ -8,16 +8,16 @@ please see Docs/README.model-combined.eff for documentation
|
|||
|
||||
<parameters>
|
||||
<!-- Diffuse Texture -->
|
||||
<!-- <texture n ="0">
|
||||
<!-- <texture n ="0">
|
||||
<type>white</type>
|
||||
</texture>-->
|
||||
</texture>-->
|
||||
<!-- Normal Map -->
|
||||
<normalmap-enabled type="int">0</normalmap-enabled>
|
||||
<normalmap-dds type="int">0</normalmap-dds>
|
||||
<normalmap-tiling type="float">1.0</normalmap-tiling>
|
||||
<texture n="2">
|
||||
<image>Aircraft/Generic/Effects/null_bumpspec.png</image>
|
||||
<type>2d</type>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>clamp</wrap-s>
|
||||
<wrap-t>clamp</wrap-t>
|
||||
|
@ -36,7 +36,7 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<lightmap-color type="vec3d" n="3"> 1.0 1.0 1.0 </lightmap-color>
|
||||
<texture n="3">
|
||||
<image>Aircraft/Generic/Effects/greymap.png</image>
|
||||
<type>2d</type>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>clamp</wrap-s>
|
||||
<wrap-t>clamp</wrap-t>
|
||||
|
@ -49,7 +49,7 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<reflection-dynamic type="int">0</reflection-dynamic>
|
||||
<texture n="4">
|
||||
<image>Aircraft/Generic/Effects/ReflectMaps/reflectmap.png</image>
|
||||
<type>2d</type>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>clamp</wrap-s>
|
||||
<wrap-t>clamp</wrap-t>
|
||||
|
@ -76,7 +76,7 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<reflection-fresnel type="float">0.1</reflection-fresnel>
|
||||
<texture n="6">
|
||||
<image>Aircraft/Generic/Effects/Gradients.png</image>
|
||||
<type>2d</type>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
|
@ -91,7 +91,7 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<grain-magnification type="float">10</grain-magnification>
|
||||
<texture n="7">
|
||||
<image>Textures/Terrain/void.png</image>
|
||||
<type>2d</type>
|
||||
<type>2d</type>
|
||||
<filter>linear-mipmap-linear</filter>
|
||||
<wrap-s>repeat</wrap-s>
|
||||
<wrap-t>repeat</wrap-t>
|
||||
|
@ -109,10 +109,6 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<dirt-factor type="float" n="2">0.0</dirt-factor>
|
||||
<!-- ambient correction -->
|
||||
<ambient-correction type="float">0.05</ambient-correction>
|
||||
<!-- quality slider -->
|
||||
<shader-quality type="int">
|
||||
<use>/sim/rendering/shaders/model</use>
|
||||
</shader-quality>
|
||||
<rendering-hint>opaque</rendering-hint>
|
||||
<transparent>false</transparent>
|
||||
<render-bin>
|
||||
|
@ -245,9 +241,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
|
@ -272,9 +268,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
|
@ -294,9 +290,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
|
@ -316,9 +312,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
|
@ -355,9 +351,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
|
@ -377,9 +373,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[7]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[7]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[7]/filter</use>
|
||||
</filter>
|
||||
|
@ -712,14 +708,6 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
|
@ -922,9 +910,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[0]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[0]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[0]/filter</use>
|
||||
</filter>
|
||||
|
@ -949,9 +937,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[2]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[2]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[2]/filter</use>
|
||||
</filter>
|
||||
|
@ -971,9 +959,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[3]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[3]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[3]/filter</use>
|
||||
</filter>
|
||||
|
@ -993,9 +981,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[4]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[4]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[4]/filter</use>
|
||||
</filter>
|
||||
|
@ -1032,9 +1020,9 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<image>
|
||||
<use>texture[6]/image</use>
|
||||
</image>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<type>
|
||||
<use>texture[6]/type</use>
|
||||
</type>
|
||||
<filter>
|
||||
<use>texture[6]/filter</use>
|
||||
</filter>
|
||||
|
@ -1353,14 +1341,6 @@ please see Docs/README.model-combined.eff for documentation
|
|||
<use>ambient-correction</use>
|
||||
</value>
|
||||
</uniform>
|
||||
<!-- shader quality -->
|
||||
<uniform>
|
||||
<name>shader_qual</name>
|
||||
<type>int</type>
|
||||
<value>
|
||||
<use>shader-quality</use>
|
||||
</value>
|
||||
</uniform>
|
||||
|
||||
<uniform>
|
||||
<name>hdg</name>
|
||||
|
|
|
@ -64,17 +64,20 @@ void main(void)
|
|||
normal.xy = vec2(dot(normal.xy, vec2(cr, sr)), dot(normal.xy, vec2(-sr, cr)));
|
||||
//normal = gl_NormalMatrix * normal;
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * normal);
|
||||
if (nmap_enabled > 0 && shader_qual > 2){
|
||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * binormal);
|
||||
} else {
|
||||
VTangent = vec3(0.0);
|
||||
VBinormal = vec3 (0.0);
|
||||
}
|
||||
vec3 n = normalize(normal);
|
||||
vec3 t = cross(n, vec3(1.0,0.0,0.0));
|
||||
vec3 b = cross(n,t);
|
||||
VNormal = normalize(gl_NormalMatrix * normal);
|
||||
vec3 n = normalize(normal);
|
||||
vec3 tempTangent = cross(n, vec3(1.0,0.0,0.0));
|
||||
vec3 tempBinormal = cross(n, tempTangent);
|
||||
|
||||
if (nmap_enabled > 0){
|
||||
tempTangent = tangent;
|
||||
tempBinormal = binormal;
|
||||
}
|
||||
|
||||
VTangent = normalize(gl_NormalMatrix * tempTangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * tempBinormal);
|
||||
vec3 t = tempTangent;
|
||||
vec3 b = tempBinormal;
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
// Authors: Frederic Bouvier and Gijs de Rooy
|
||||
// with major additions and revisions by
|
||||
// Emilian Huminiuc and Vivian Meazza 2011
|
||||
#version 120
|
||||
|
||||
varying vec3 rawpos;
|
||||
varying vec3 VNormal;
|
||||
|
@ -27,7 +28,6 @@ uniform int refl_enabled;
|
|||
uniform int refl_map;
|
||||
uniform int lightmap_enabled;
|
||||
uniform int lightmap_multi;
|
||||
uniform int shader_qual;
|
||||
uniform int dirt_enabled;
|
||||
uniform int dirt_multi;
|
||||
|
||||
|
@ -80,7 +80,7 @@ void main (void)
|
|||
float pf;
|
||||
|
||||
///BEGIN bump
|
||||
if (nmap_enabled > 0 && shader_qual > 2){
|
||||
if (nmap_enabled > 0){
|
||||
N = nmap.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
if (nmap_dds > 0)
|
||||
|
@ -100,7 +100,7 @@ void main (void)
|
|||
////////////////////////////////////////////////////////////////////
|
||||
//BEGIN reflect
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (refl_enabled > 0 && shader_qual > 1){
|
||||
if (refl_enabled > 0){
|
||||
float reflFactor;
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset
|
||||
if(refl_map > 0){
|
||||
|
@ -163,7 +163,7 @@ void main (void)
|
|||
vec3 lightmapcolor;
|
||||
vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor, lightmap_b_factor, lightmap_a_factor);
|
||||
lightmapFactor = lightmapFactor * lightmapTexel;
|
||||
if (lightmap_multi >0 ){
|
||||
if (lightmap_multi > 0 ){
|
||||
lightmapcolor = lightmap_r_color * lightmapFactor.r +
|
||||
lightmap_g_color * lightmapFactor.g +
|
||||
lightmap_b_color * lightmapFactor.b +
|
||||
|
|
|
@ -36,7 +36,6 @@ uniform int nmap_dds;
|
|||
uniform int nmap_enabled;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_map;
|
||||
uniform int shader_qual;
|
||||
uniform int grain_texture_enabled;
|
||||
|
||||
uniform float amb_correction;
|
||||
|
@ -218,7 +217,7 @@ void main (void)
|
|||
/// END grain overlay
|
||||
|
||||
///BEGIN bump
|
||||
if (nmap_enabled > 0 && shader_qual > 2){
|
||||
if (nmap_enabled > 0){
|
||||
N = nmap.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
if (nmap_dds > 0)
|
||||
|
@ -258,7 +257,7 @@ void main (void)
|
|||
////////////////////////////////////////////////////////////////////
|
||||
//BEGIN reflect
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (refl_enabled > 0 && shader_qual > 1){
|
||||
if (refl_enabled > 0){
|
||||
float reflFactor = 0.0;
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset
|
||||
|
||||
|
@ -266,7 +265,7 @@ void main (void)
|
|||
// map the shininess of the object with user input
|
||||
//float pam = (map.a * -2) + 1; //reverse map
|
||||
reflFactor = reflmap.a + transparency_offset;
|
||||
} else if (nmap_enabled > 0 && shader_qual > 2) {
|
||||
} else if (nmap_enabled > 0) {
|
||||
// set the reflectivity proportional to shininess with user input
|
||||
reflFactor = gl_FrontMaterial.shininess * 0.0078125 * nmap.a + transparency_offset;
|
||||
} else {
|
||||
|
@ -331,7 +330,7 @@ void main (void)
|
|||
vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor,
|
||||
lightmap_b_factor, lightmap_a_factor);
|
||||
lightmapFactor = lightmapFactor * lightmapTexel;
|
||||
if (lightmap_multi >0 ){
|
||||
if (lightmap_multi > 0 ){
|
||||
lightmapcolor = lightmap_r_color * lightmapFactor.r +
|
||||
lightmap_g_color * lightmapFactor.g +
|
||||
lightmap_b_color * lightmapFactor.b +
|
||||
|
|
|
@ -30,7 +30,6 @@ uniform int nmap_dds;
|
|||
uniform int nmap_enabled;
|
||||
uniform int refl_enabled;
|
||||
uniform int refl_map;
|
||||
uniform int shader_qual;
|
||||
|
||||
uniform float amb_correction;
|
||||
uniform float dirt_b_factor;
|
||||
|
@ -73,7 +72,7 @@ void main (void)
|
|||
float pf = 0.0;
|
||||
|
||||
///BEGIN bump
|
||||
if (nmap_enabled > 0 && shader_qual > 2){
|
||||
if (nmap_enabled > 0 ){
|
||||
N = nmap.rgb * 2.0 - 1.0;
|
||||
N = normalize(N.x * VTangent + N.y * VBinormal + N.z * VNormal);
|
||||
if (nmap_dds > 0)
|
||||
|
@ -111,7 +110,7 @@ void main (void)
|
|||
////////////////////////////////////////////////////////////////////
|
||||
//BEGIN reflect
|
||||
////////////////////////////////////////////////////////////////////
|
||||
if (refl_enabled > 0 && shader_qual > 1){
|
||||
if (refl_enabled > 0 ){
|
||||
float reflFactor = 0.0;
|
||||
float transparency_offset = clamp(refl_correction, -1.0, 1.0);// set the user shininess offset
|
||||
|
||||
|
@ -119,7 +118,7 @@ void main (void)
|
|||
// map the shininess of the object with user input
|
||||
//float pam = (map.a * -2) + 1; //reverse map
|
||||
reflFactor = reflmap.a + transparency_offset;
|
||||
} else if (nmap_enabled > 0 && shader_qual > 2) {
|
||||
} else if (nmap_enabled > 0) {
|
||||
// set the reflectivity proportional to shininess with user input
|
||||
reflFactor = gl_FrontMaterial.shininess * 0.0078125 * nmap.a + transparency_offset;
|
||||
} else {
|
||||
|
@ -182,7 +181,7 @@ void main (void)
|
|||
vec4 lightmapFactor = vec4(lightmap_r_factor, lightmap_g_factor,
|
||||
lightmap_b_factor, lightmap_a_factor);
|
||||
lightmapFactor = lightmapFactor * lightmapTexel;
|
||||
if (lightmap_multi >0 ){
|
||||
if (lightmap_multi > 0 ){
|
||||
lightmapcolor = lightmap_r_color * lightmapFactor.r +
|
||||
lightmap_g_color * lightmapFactor.g +
|
||||
lightmap_b_color * lightmapFactor.b +
|
||||
|
|
|
@ -52,19 +52,23 @@ void main(void)
|
|||
//fog_Func(fogType);
|
||||
|
||||
VNormal = normalize(gl_NormalMatrix * gl_Normal);
|
||||
if (nmap_enabled > 0 && shader_qual > 2){
|
||||
VTangent = normalize(gl_NormalMatrix * tangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * binormal);
|
||||
} else {
|
||||
VTangent = vec3(0.0);
|
||||
VBinormal = vec3 (0.0);
|
||||
}
|
||||
vec3 n = normalize(gl_Normal);
|
||||
vec3 t = cross(n, vec3(1.0,0.0,0.0));
|
||||
vec3 b = cross(n,t);
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
vec3 n = normalize(gl_Normal);
|
||||
vec3 tempTangent = cross(n, vec3(1.0,0.0,0.0));
|
||||
vec3 tempBinormal = cross(n, tempTangent);
|
||||
|
||||
if (nmap_enabled > 0){
|
||||
tempTangent = tangent;
|
||||
tempBinormal = binormal;
|
||||
}
|
||||
|
||||
VTangent = normalize(gl_NormalMatrix * tempTangent);
|
||||
VBinormal = normalize(gl_NormalMatrix * tempBinormal);
|
||||
vec3 t = tempTangent;
|
||||
vec3 b = tempBinormal;
|
||||
|
||||
// Super hack: if diffuse material alpha is less than 1, assume a
|
||||
// transparency animation is at work
|
||||
if (gl_FrontMaterial.diffuse.a < 1.0)
|
||||
alpha = gl_FrontMaterial.diffuse.a;
|
||||
else
|
||||
|
@ -76,7 +80,7 @@ void main(void)
|
|||
vViewVec.y = dot(b, vertVec);
|
||||
vViewVec.z = dot(n, vertVec);
|
||||
|
||||
// calculate the reflection vector
|
||||
// calculate the reflection vector
|
||||
vec4 reflect_eye = vec4(reflect(vertVec, VNormal), 0.0);
|
||||
vec3 reflVec_stat = normalize(gl_ModelViewMatrixInverse * reflect_eye).xyz;
|
||||
if (refl_dynamic > 0){
|
||||
|
|
|
@ -230,9 +230,9 @@
|
|||
<slider>
|
||||
<name>model</name>
|
||||
<min>0.0</min>
|
||||
<max>3.0</max>
|
||||
<max>1.0</max>
|
||||
<step>1.0</step>
|
||||
<fraction>0.25</fraction>
|
||||
<fraction>0.5</fraction>
|
||||
<live>true</live>
|
||||
<property>/sim/rendering/shaders/model</property>
|
||||
<binding>
|
||||
|
|
Loading…
Reference in a new issue