574
edits
(→Uniforms passed to shaders outside the xml effect framework: Some new info from Icecode) |
|||
(3 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{forum|47|Effects & Shaders}} | |||
{{Rendering}} | |||
The effect framework as per version 2019.1 | The effect framework as per version 2019.1 | ||
Line 338: | Line 340: | ||
Example: | Example: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
< | <blend> | ||
<active>true</active> | <active>true</active> | ||
<source>one-minus-dst-alpha</source> | <source>one-minus-dst-alpha</source> | ||
<destination>src-alpha-saturate</destination> | <destination>src-alpha-saturate</destination> | ||
</ | </blend> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 449: | Line 451: | ||
</program> | </program> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
See this page for more about shaders: [[Howto:Shader programming in FlightGear]] | |||
=Uniforms passed to shaders outside the xml effect framework= | =Uniforms passed to shaders outside the xml effect framework= | ||
Line 459: | Line 463: | ||
|<tt>fg_ViewMatrix</tt> | |<tt>fg_ViewMatrix</tt> | ||
|<tt>mat4</tt> | |<tt>mat4</tt> | ||
|In fullscreen pass only, view matrix used to transform | |In fullscreen pass only, view matrix used to transform from world to view space. Same as osg_ViewMatrix, but for fullscreen pass. | ||
|- | |- | ||
|<tt>fg_ViewMatrixInverse</tt> | |<tt>fg_ViewMatrixInverse</tt> | ||
|<tt>mat4</tt> | |<tt>mat4</tt> | ||
|In fullscreen pass only, view matrix inverse used to transform | |In fullscreen pass only, view matrix inverse used to transform from view to world space. Same as osg_ViewMatrixInverse but for fullscreen pass. | ||
|- | |- | ||
|<tt>fg_ProjectionMatrixInverse</tt> | |<tt>fg_ProjectionMatrixInverse</tt> | ||
|<tt>mat4</tt> | |<tt>mat4</tt> | ||
|In fullscreen pass only, projection matrix inverse | |In fullscreen pass only, projection matrix inverse | ||
|- | |- | ||
|<tt>fg_CameraPositionCart</tt> | |<tt>fg_CameraPositionCart</tt> | ||
Line 479: | Line 483: | ||
|<tt>fg_SunAmbientColor</tt> | |<tt>fg_SunAmbientColor</tt> | ||
|<tt>vec4</tt> | |<tt>vec4</tt> | ||
| | |For fullscreen pass only, sun information as lightsource[0] is not available in fullscreen pass. | ||
|- | |- | ||
|<tt>fg_SunDiffuseColor</tt> | |<tt>fg_SunDiffuseColor</tt> | ||
|<tt>vec4</tt> | |<tt>vec4</tt> | ||
| | |For fullscreen pass only, sun information as lightsource[0] is not available in fullscreen pass. | ||
|- | |- | ||
|<tt>fg_SunSpecularColor</tt> | |<tt>fg_SunSpecularColor</tt> | ||
|<tt>vec4</tt> | |<tt>vec4</tt> | ||
| | |For fullscreen pass only, sun information as lightsource[0] is not available in fullscreen pass. | ||
|- | |- | ||
|<tt>fg_SunDirection</tt> | |<tt>fg_SunDirection</tt> | ||
|<tt>vec3</tt> | |<tt>vec3</tt> | ||
| | |For fullscreen pass only, sun information as lightsource[0] is not available in fullscreen pass. | ||
|- | |- | ||
|<tt>fg_FogColor</tt> | |<tt>fg_FogColor</tt> | ||
Line 523: | Line 527: | ||
|<tt>osg_ViewMatrix</tt> | |<tt>osg_ViewMatrix</tt> | ||
|<tt>mat4</tt> | |<tt>mat4</tt> | ||
|Defined by OSG, used only when working on actual geometry | |Defined by OSG, used only when working on actual geometry. Transforms from world to view space. | ||
|- | |- | ||
|<tt>osg_ViewMatrixInverse</tt> | |<tt>osg_ViewMatrixInverse</tt> | ||
|<tt>mat4</tt> | |<tt>mat4</tt> | ||
|Defined by OSG, used only when working on actual geometry | |Defined by OSG, used only when working on actual geometry. Transforms from view to world space. | ||
|- | |- | ||
|<tt>osg_SimulationTime</tt> | |<tt>osg_SimulationTime</tt> |
edits