343
edits
No edit summary |
No edit summary |
||
Line 68: | Line 68: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<effect> | |||
<inherits-from>Effects/light-cone</inherits-from> | |||
<object-name>Cone</object-name> | |||
</effect> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 86: | Line 86: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<animation> | |||
<type>shader</type> | |||
<shader>chrome</shader> | |||
<texture>glass_shader.png</texture> | |||
<object-name>windscreen</object-name> | |||
</animation> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 145: | Line 145: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<generate> | |||
<tangent type="int">6</tangent> | |||
<binormal type="int">7</binormal> | |||
<normal type="int">8</normal> | |||
</generate> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 164: | Line 164: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<program> | |||
<vertex-shader>my_vertex_shader</vertex-shader> | |||
<attribute> | |||
<name>my_tangent_attribute</name> | |||
<index>6</index> | |||
</attribute> | |||
<attribute> | |||
<name>my_binormal_attribute</name> | |||
<index>7</index> | |||
</attribute> | |||
</program> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 205: | Line 205: | ||
The proper way to test whether to enable a shader-based technique is: | The proper way to test whether to enable a shader-based technique is: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<predicate> | |||
<and> | |||
<property>/sim/rendering/shader-effects</property> | |||
<less-equal> | |||
<value type="float">1.0</value> | |||
<shader-language/> | |||
</less-equal> | |||
</and> | |||
</predicate> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 220: | Line 220: | ||
like this : | like this : | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<predicate> | |||
<and> | |||
<property>/sim/rendering/shader-effects</property> | |||
<less-equal> | |||
<value type="float">2.0</value> | |||
<float-property>/sim/rendering/quality-level</float-property> | |||
</less-equal> | |||
<!-- other predicate conditions --> | |||
</and> | |||
</predicate> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 240: | Line 240: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<predicate> | <predicate> | ||
<and> | |||
<property>/sim/rendering/shaders/quality-level</property> | |||
<property>/sim/rendering/shaders/model</property> | |||
<or> | |||
<less-equal> | |||
<value type="float">2.0</value> | |||
<glversion/> | |||
</less-equal> | |||
<and> | |||
<extension-supported>GL_ARB_shader_objects</extension-supported> | |||
<extension-supported>GL_ARB_shading_language_100</extension-supported> | |||
<extension-supported>GL_ARB_vertex_shader</extension-supported> | |||
<extension-supported>GL_ARB_fragment_shader</extension-supported> | |||
</and> | |||
</or> | |||
</and> | |||
</predicate> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 272: | Line 272: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<blend> | |||
<active><use>blend/active</use></active> | |||
<source>src-alpha</source> | |||
<destination>one-minus-src-alpha</destination> | |||
</blend> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 287: | Line 287: | ||
constant. For example: | constant. For example: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<uniform> | |||
<name>ColorsTex</name> | |||
<type>sampler-1d</type> | |||
<value type="int">2</value> | |||
</uniform> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
* The name of a property in the parameters section can be | * The name of a property in the parameters section can be | ||
Line 297: | Line 297: | ||
section: | section: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<material> | |||
<ambient><use>material/ambient</use></ambient> | |||
</material> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Then, in the parameters section of the effect: | Then, in the parameters section of the effect: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<parameters> | |||
<material> | |||
<ambient type="vec4d">0.2 0.2 0.2 1.0</ambient> | |||
</material> | |||
</parameters> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
It's worth pointing out that the "material" property in a | It's worth pointing out that the "material" property in a | ||
Line 323: | Line 323: | ||
YET]. For example: | YET]. For example: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<parameters> | |||
<chrome-light><use>/rendering/scene/chrome-light</use></chrome-light> | |||
</parameters> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
The type is determined by what is expected by the technique | The type is determined by what is expected by the technique | ||
Line 350: | Line 350: | ||
Example: | Example: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<blend> | |||
<active>true</active> | |||
<source>one-minus-dst-alpha</source> | |||
<destination>src-alpha-saturate</destination> | |||
</blend> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 363: | Line 363: | ||
Example: | Example: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<blend>1</blend> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 408: | Line 408: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<texture-unit> | |||
<unit>3</unit> | |||
<image>Textures/Terrain/void.png</image> | |||
<type>2d</type> | |||
<filter>linear-mipmap-linear</filter> | |||
<mag-filter>linear-mipmap-linear</mag-filter> | |||
<wrap-s>repeat</wrap-s> | |||
<wrap-t>repeat</wrap-t> | |||
<wrap-r>repeat</wrap-r> | |||
<internal-format>normalized</internal-format> | |||
<mipmap-control> | |||
<function-r>average</function-r> | |||
<function-g>min</function-g> | |||
<function-b>sum</function-b> | |||
<function-a>product</function-a> | |||
</mipmap-control> | |||
<environment> | |||
<mode>decal</mode> | |||
<color>0.0 0.1 0.6 1.0</color> | |||
</environment> | |||
<point-sprite>true</point-sprite> | |||
<texenv-combine>operand0-rgb</texenv-combine> | |||
<texgen> | |||
<mode>S</mode> | |||
<planes>0.075, 0.0, 0.0, 0.5</planes> | |||
</texgen> | |||
</texture-unit> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 516: | Line 516: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<program> | <program> | ||
<vertex-shader n="0">Shaders/lcd.vert</vertex-shader> | |||
<fragment-shader n="0">Shaders/lcd.frag</fragment-shader> | |||
<fragment-shader n="1">Shaders/noise.frag</fragment-shader> | |||
<fragment-shader n="2">Shaders/filters-ALS.frag</fragment-shader> | |||
</program> | </program> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
See this page for more about shaders: [[Howto:Shader programming in FlightGear]] | See this page for more about shaders: [[Howto:Shader programming in FlightGear]] |
edits