Quality slider overwrites custom shader settings. All effects now listen to the new...
[fg:toms-fgdata.git] / Effects / bumpspec.eff
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- Bump and specular effect
3 parameters :
4     texture[0] -> colormap
5     texture[2] -> normal map + specularity in alpha channel
6
7 eg :
8 in model.xml :
9     <effect>
10   <inherits-from>Aircraft/A320/Models/Effects/bumpspec</inherits-from>
11   <object-name>Fuselage</object-name>
12     </effect>
13
14 in Aircraft/A320/Models/Effects/a320_bumpspec.eff ( or whatever, private to the model )
15
16 <PropertyList>
17   <name>Aircraft/A320/Models/Effects/a320_bumpspec</name>
18   <inherits-from>Effects/bumpspec</inherits-from>
19   <parameters>
20     <texture n="2">
21       <image>Aircraft/A320/Models/Effects/textures/a320_normals.png</image>
22       <filter>linear-mipmap-linear</filter>
23       <wrap-s>repeat</wrap-s>
24       <wrap-t>repeat</wrap-t>
25       <internal-format>normalized</internal-format>
26     </texture>
27   </parameters>
28 </PropertyList>
29 -->
30 <PropertyList>
31   <name>Effects/bumpspec</name>
32   <inherits-from>Effects/model-default</inherits-from>
33   <generate>
34     <tangent type="int">6</tangent>
35     <binormal type="int">7</binormal>
36   </generate>
37   <technique n="10">
38     <predicate>
39       <and>
40         <property>/sim/rendering/shaders/model</property>
41         <or>
42           <less-equal>
43             <value type="float">2.0</value>
44             <glversion/>
45           </less-equal>
46           <and>
47             <extension-supported>GL_ARB_shader_objects</extension-supported>
48             <extension-supported>GL_ARB_shading_language_100</extension-supported>
49             <extension-supported>GL_ARB_vertex_shader</extension-supported>
50             <extension-supported>GL_ARB_fragment_shader</extension-supported>
51           </and>
52         </or>
53       </and>
54     </predicate>
55     <pass>
56       <texture-unit>
57         <unit>0</unit>
58         <image><use>texture[0]/image</use></image>
59         <filter><use>texture[0]/filter</use></filter>
60         <wrap-s><use>texture[0]/wrap-s</use></wrap-s>
61         <wrap-t><use>texture[0]/wrap-t</use></wrap-t>
62         <internal-format><use>texture[0]/internal-format</use></internal-format>
63       </texture-unit>
64       <texture-unit>
65         <unit>1</unit>
66         <image><use>texture[2]/image</use></image>
67         <filter><use>texture[2]/filter</use></filter>
68         <wrap-s><use>texture[2]/wrap-s</use></wrap-s>
69         <wrap-t><use>texture[2]/wrap-t</use></wrap-t>
70         <internal-format><use>texture[2]/internal-format</use></internal-format>
71       </texture-unit>
72       <program>
73         <vertex-shader n="1">Shaders/bumpspec.vert</vertex-shader>
74         <fragment-shader n="1">Shaders/bumpspec.frag</fragment-shader>
75         <attribute>
76           <name>tangent</name>
77           <index>6</index>
78         </attribute>
79         <attribute>
80           <name>binormal</name>
81           <index>7</index>
82         </attribute>
83       </program>
84       <uniform>
85         <name>tex_color</name>
86         <type>sampler-2d</type>
87         <value type="int">0</value>
88       </uniform>
89       <uniform>
90         <name>tex_normal</name>
91         <type>sampler-2d</type>
92         <value type="int">1</value>
93       </uniform>
94     </pass>
95   </technique>
96 </PropertyList>