It's not Rembrandt, and it's computationally dead cheap:
(so far just a simple proof of concept, the technique is similar to the cloud shadows)
Thorsten wrote in Sat Oct 04, 2014 12:10 pm:That wouldn't be a real light like in Rembrandt, but I suspect it may be close enough that you can't tell the difference unless you go looking specifically.
it projects correctly and has 1/r^2 fading in the distance.
Also, landing lights which work from the cockpit only would be much easier than those which work in external views as well.
Thorsten wrote in Sat Oct 04, 2014 9:37 am:the technique is similar to the cloud shadows
And I guess it can only be supported easily for a cockpit-only camera view and the main aircraft, right ?
Why is that? Because of the distance fading?
In other words: does it light up *everything* in the scene or only the ground (terrain/runway) ?
uniform int use_searchlight;
uniform int use_landing_light;
vec3 searchlight(in float dist);
vec3 landing_light(in float dist);
if (use_searchlight == 1)
{
color.rgb += searchlight(dist);
}
if (use_landing_light == 1)
{
color.rgb += landing_light(dist);
}
fragColor = color * texel + specular;
(about line 29)
<display_xsize><use>/sim/startup/xsize</use></display_xsize>
<display_ysize><use>/sim/startup/ysize</use></display_ysize>
<view_pitch_offset><use>/sim/current-view/pitch-offset-deg</use></view_pitch_offset>
<view_heading_offset><use>/sim/current-view/heading-offset-deg</use></view_heading_offset>
<view_fov><use>/sim/current-view/field-of-view</use></view_fov>
<use_searchlight><use>/sim/rendering/als-secondary-lights/use-searchlight</use></use_searchlight>
<use_landing_light><use>/sim/rendering/als-secondary-lights/use-landing-light</use></use_landing_light>
(in <program>)
<vertex-shader>Shaders/terrain-haze-ultra.vert</vertex-shader>
<fragment-shader>Shaders/terrain-haze-ultra.frag</fragment-shader>
<fragment-shader>Shaders/secondary_lights.frag</fragment-shader>
(with other uniforms)
<uniform>
<name>view_pitch_offset</name>
<type>float</type>
<value><use>view_pitch_offset</use></value>
</uniform>
<uniform>
<name>view_heading_offset</name>
<type>float</type>
<value><use>view_heading_offset</use></value>
</uniform>
<uniform>
<name>field_of_view</name>
<type>float</type>
<value><use>view_fov</use></value>
</uniform>
<uniform>
<name>use_searchlight</name>
<type>int</type>
<value><use>use_searchlight</use></value>
</uniform>
<uniform>
<name>use_landing_light</name>
<type>int</type>
<value><use>use_landing_light</use></value>
</uniform>
<uniform>
<name>display_xsize</name>
<type>int</type>
<value><use>display_xsize</use></value>
</uniform>
<uniform>
<name>display_ysize</name>
<type>int</type>
<value><use>display_ysize</use></value>
</uniform>
(I tried it in both technique 5 and 11 not knowing for sure where it should go)
<vertex-shader>Shaders/terrain-haze-ultra.vert</vertex-shader>
<fragment-shader>Shaders/terrain-haze-ultra.frag</fragment-shader>
<fragment-shader>Shaders/secondary_lights.frag</fragment-shader>
<property>/sim/rendering/shaders/skydome</property>
<program>
<vertex-shader n="1">Shaders/ubershader.vert</vertex-shader>
<fragment-shader n="1">Shaders/ubershader-lightfield.frag</fragment-shader>
<fragment-shader n="2">Shaders/cloud-shadowfunc.frag</fragment-shader>
</program>
<program>
<vertex-shader>Shaders/terrain-haze.vert</vertex-shader>
<fragment-shader>Shaders/terrain-haze.frag</fragment-shader>
<fragment-shader>Shaders/secondary_lights.frag</fragment-shader>
</program>
Users browsing this forum: No registered users and 1 guest