1
0
Fork 0

Simple Aurora Borealis strength manager dependent on viewer latitude

This commit is contained in:
Thorsten Renk 2016-01-10 13:00:15 +02:00
parent 3ab3ba72e6
commit 459d8a02e0
4 changed files with 122 additions and 1 deletions

View file

@ -441,6 +441,7 @@
<!-- definitions for aurorae --> <!-- definitions for aurorae -->
<aurora> <aurora>
<set-strength type="double" userarchive="n">0.0</set-strength>
<strength type="double" userarchive="n">0.0</strength> <strength type="double" userarchive="n">0.0</strength>
<vsize type="double" userarchive="n">0.4</vsize> <vsize type="double" userarchive="n">0.4</vsize>
<hsize type="double" userarchive="n">0.4</hsize> <hsize type="double" userarchive="n">0.4</hsize>

View file

@ -846,4 +846,77 @@
<max>1.0</max> <max>1.0</max>
</filter> </filter>
<filter>
<name>EnvironmentInterpolator:Aurora:LatitudeDep</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<pow>
<div>
<abs>
<property>/position/latitude-deg</property>
</abs>
<value>90</value>
</div>
<value>2.0</value>
</pow>
</expression>
</input>
<output>/environment/aurora/latitude-scale</output>
</filter>
<filter>
<name>EnvironmentInterpolator:Aurora:VerticalSize</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<max>
<pow>
<property>/environment/aurora/latitude-scale</property>
<value>2.0</value>
</pow>
<value>0.1</value>
</max>
</expression>
</input>
<output>/environment/aurora/vsize</output>
</filter>
<filter>
<name>EnvironmentInterpolator:Aurora:HorizontalSize</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<max>
<property>/environment/aurora/latitude-scale</property>
<value>0.1</value>
</max>
</expression>
</input>
<output>/environment/aurora/hsize</output>
</filter>
<filter>
<name>EnvironmentInterpolator:Aurora:Strength</name>
<type>gain</type>
<gain>1.0</gain>
<input>
<expression>
<product>
<pow>
<property>/environment/aurora/latitude-scale</property>
<value>0.5</value>
</pow>
<property>/environment/aurora/set-strength</property>
</product>
</expression>
</input>
<output>/environment/aurora/strength</output>
</filter>
</PropertyList> </PropertyList>

View file

@ -126,7 +126,7 @@ void main()
// Aurora Borealis / Australis // Aurora Borealis / Australis
vec3 direction = vec3 (-1.0, 0.0, 0.0); vec3 direction = vec3 (1.0, 0.0, 0.0);
float hArg = dot(nView, direction); float hArg = dot(nView, direction);

View file

@ -489,6 +489,53 @@
<col>3</col> <col>3</col>
</text> </text>
<text>
<enable>
<property>/sim/rendering/shaders/skydome</property>
</enable>
<label> Aurora Borealis</label>
<halign>left</halign>
<row>10</row>
<col>0</col>
</text>
<text>
<enable>
<property>/sim/rendering/shaders/skydome</property>
</enable>
<label>weak</label>
<halign>right</halign>
<row>10</row>
<col>1</col>
</text>
<slider>
<enable>
<property>/sim/rendering/shaders/skydome</property>
</enable>
<name>aurora</name>
<row>10</row>
<col>2</col>
<min>0.0</min>
<max>1.0</max>
<live>true</live>
<property>/environment/aurora/set-strength</property>
<binding>
<command>dialog-apply</command>
<object-name>aurora</object-name>
</binding>
</slider>
<text>
<enable>
<property>/sim/rendering/shaders/skydome</property>
</enable>
<label>strong</label>
<halign>left</halign>
<row>10</row>
<col>3</col>
</text>
</group> </group>