Talk:ALS technical notes: Difference between revisions
Line 124: | Line 124: | ||
<i>/* Fading of a directional light */ | <i>/* Fading of a directional light */ | ||
Note: To better explain the relation of the variables inner_angle, outer_angle and zero angle, this is the algorithm that produces the scalar value directional_fade from which the intensity value is defined in the shaders file light-ALS.frag: | Note: To better explain the relation of the variables inner_angle, outer_angle and zero angle, this is the algorithm that produces the scalar value directional_fade from which the intensity value is defined in the shaders file light-ALS.frag: </i> | ||
float directional_fade (in float direction) { | float directional_fade (in float direction) { | ||
float arg = clamp(direction, 0.0, 1.0); | float arg = clamp(direction, 0.0, 1.0); | ||
float ia = (1.0 - inner_angle); | float ia = (1.0 - inner_angle); | ||
Line 136: | Line 136: | ||
{return outer_gain * (direction - za) / (oa - za);} | {return outer_gain * (direction - za) / (oa - za);} | ||
else {return 0.0;} | else {return 0.0;} | ||
} | } | ||
Quoting GLSL code in the wiki is risky (it might change on the repository without warning), too detailed and misleading (generally people tend to expect copy/pastable examples). | Quoting GLSL code in the wiki is risky (it might change on the repository without warning), too detailed and misleading (generally people tend to expect copy/pastable examples). | ||
If more explanation is required, either link to the shader code on the repository or make an illustration please. | If more explanation is required, either link to the shader code on the repository or make an illustration please. |
Revision as of 06:22, 3 August 2018
ALS vs. Rembrandt
Rembrandt and ALS work with two different rendering pipelines/implementations using very different assumptions - thus, it would be a lot of work to integrate those two properly, and as has been said, Rembrandt isn't beint actively maintained currently, while ALS has been under active development.
— Hooray (Tue Sep 02). Re: Why in Rembrandt, can not be activated Atmospheric light.
(powered by Instant-Cquotes) |
For my visual preferences and on my system ALS is a much better use of what rendering resources there are than Rembrandt and the view out the windows is superior to that of the default scheme.
|
Do we actually have to have the ALS vs. Rembrandt philosophy here? I'm trying to create a technical documentation page which should be concise and to the point, I can't see how the assortment of things I have said about ALS and Rembrandt features here.
- it's your article, so feel free to remove whatever you disagree with - that said, your quotes may still be useful elsewhere, especially because the whole Rembrandt vs. ALS debate is a recurring one, so maybe some kind of FAQ ? I don't know ... I just added some of your quotes here to ensure that people can refer to those arguments, without having to resurrect these debates on the forum over and over again. If you think there is a better way to accomplish that, it's your call. --Hooray (talk) 06:29, 11 March 2015 (EDT)
Surfaces
There is internally no 'ALS' or 'Rembrandt' in the effect framework. We assign effects to surfaces. These effects have techniques which depend on conditionals (predicates), always the first matching technique of an effect is used. It is at the level of these conditionals that we decide upon ALS or Rembrandt.
This is not a must - it would be easy to write an effect which only runs ALS, even if Rembrandt is on. Just leave the conditional out of the technique.
The opposite is pretty much what happens if you assign model-transparent to a surface. This is an effect which has just a single technique (a fixed pipeline setup). Which means that you get transparency rendered okayish, no depth buffer written and outside- in rendering of a depth ordered bin - but at the same time, this technique wrecks ALS light and fog - at night at high altitude the glass will glow faintly red (because that's the light setting of the default renderer) and you will see it through fog no matter the distance.
Now, an unassigned surface uses the general-purpose model-default.eff. This has depth buffer writing and no outside-in rendering and does not use a depth sorted bin - so it may have issues for transparent surfaces. But this has a proper sequence of conditionals and will run ALS when ALS is selected and Rembrandt when Rembrandt is selected, i.e. always get lighting and fogging right.
The glass effect eventually will be one way to render glass in ALS (intended for windows seen from inside). It has correct lighting and fogging, and it will soon use the depth sorted bin and do all the other transparent stuff - and automatically dispatch the surface to the same fixed-pipeline technique Rembrandt uses in model-transparent when Rembrandt is running[1].
Article name
Looking over the page, this article seems to be devoted to describing effects based on ALS used on aircraft, while the title suggests that it describes the technical processes and details of the "works" of ALS itself. As such, would a title such as "ALS Aircraft Effects," "ALS effects" or "ALS aircraft information" be more appropriate? Adam (else MIG29pilot) (talk) 16:22, 1 January 2016 (EST)
GLSL code quoted
/* Fading of a directional light */
Note: To better explain the relation of the variables inner_angle, outer_angle and zero angle, this is the algorithm that produces the scalar value directional_fade from which the intensity value is defined in the shaders file light-ALS.frag:
float directional_fade (in float direction) { float arg = clamp(direction, 0.0, 1.0); float ia = (1.0 - inner_angle); float oa = (1.0 - outer_angle); float za = (1.0 - zero_angle); if (direction > ia) {return 1.0;} else if (direction > oa)
{return outer_gain + (1.0-outer_gain) * (direction - oa) / (ia - oa);}
else if (direction > za)
{return outer_gain * (direction - za) / (oa - za);}
else {return 0.0;} }
Quoting GLSL code in the wiki is risky (it might change on the repository without warning), too detailed and misleading (generally people tend to expect copy/pastable examples).
If more explanation is required, either link to the shader code on the repository or make an illustration please.