Well its not released yet, and I think tons of effects/shaders have to be ported first.
An example, yes, but it wont be short, lol. Took me hours to figure out some of this, should cover everything you need that is not mentioned in Icecode GL's readme:
First compile 2091.2.0 with COMPOSITOR cmake flag enabled.
Then extract and overwrite in $FGDATA with the zip file from FG Discord.
Edit Compositor/default.xml to say: <PropertyList include="ALS/als.xml"/>
Edit Compositor/ALS/als.xml and comment out the first quad.
Edit Compositor/ALS/als.xml and change the second quad's buffer to color.
Edit Compositor/ALS/als.xml and change the geometry of second quad to cover entire screen.
Edit Compositor/ALS/als.xml and change the properties in sun-shadowmap-atlas to say /sim/rendering/als/shadows/atlas-size
Edit your fuselage effect to add <scheme>als-lighting</scheme> in the ALS technique
Add this uniform to the same technique:
- Code: Select all
<uniform>
<name>shadow_tex</name>
<type>sampler-2d</type>
<value type="int">10</value>
</uniform>
Add to same technique these shaders, and edit their numbering accordingly:
- Code: Select all
<vertex-shader n="0">Compositor/Shaders/shadow-util.vert</vertex-shader>
<fragment-shader n="0">Compositor/Shaders/shadow-util.frag</fragment-shader>
Edit the ALS model fragment shader you use in same technique and add this in declarations: float getShadowing();
In same technique multiply specular and diffuse color terms with getShadowing().
Edit the ALS model vertex shader you use in same technique and add this in declarations: void setupShadows(vec4 eyeSpacePos);
Add this to bottom of same shader: setupShadows(gl_ModelViewMatrix * gl_Vertex);
Move all your local aircraft fuselage effect into Compositor (including what they inherit from), so they have same path just with compositor prepended. For example $FGDATA/Compositor/JA37/Models/Effect/fuselage/myEffect.eff
That step is so you dont have to edit hundreds of model effect paths. As in 2019.2 effects inside aircraft is no longer supported.
Start Fg with:
--prop:bool:/sim/rendering/als/shadows/enabled=true
--prop:int:/sim/rendering/als/shadows/atlas-size=2048
Make sure to run with ALS and enough model shader setting to run your desired technique.
Hope I didn't forget something.
If you want occlusion-map also you will have to implement that yourself in the shader/effect code and bake a map.