|
From: Fernando G. L. <fer...@gm...> - 2020-09-16 11:12:41
|
On Sun, Sep 13, 2020 at 2:44 AM merspieler <mer...@ai...> wrote: > I'm not even that far. > Where do I see, what is done in a pass when there's no effect tag used? Depends on the pass type. 'scene' passes render the scene graph as we have always rendered it. For example, if you use model-combined on your aircraft, those models will be rendered with model-combined. You can toggle between different versions of the same Effect depending on the current Compositor pipeline with the <scheme> tag in the technique definition. See http://wiki.flightgear.org/Compositor#Porting_and_developing_Effects.2FShaders for an use-case of effect schemes. Effects used on 'quad' passes are a little bit special. They are not applied to models on the screen, but rather to an "artificial" fullscreen quad. Consequently, Effects applied to the quad don't need to have an effect scheme. > In neither of the two ALS passes I can see any effect tags... > So where are shaders etc. defined from? The quad pass doesn't have any effect applied to it because ALS currently doesn't have any post processing effects. It'll just apply the rendered scene texture to the quad and put it on the screen. > ... I kinda feel like we're talking past each other. > You are a couple steps ahead of me. > I've still got to understand the compositor, before looking > into shaders or effects or what ever. My advice would be to get familiar with shaders first. The Compositor becomes trivial when you understand the basics behind it. > Let me give an example. > There's the cliffs.frag shader in fgdata/Compositor/Shaders/ALS/cliffs.frag > Where is it defined, that this shader should or shouldn't be used by a given > pipeline? Shaders are used by Effects in FlightGear. I can't remember the "parent" Effect of cliffs.frag off the top of my head, but for example model-ultra.frag is used by model-combined. The shader will be used if you apply that Effect to a model in your aircraft, for example. > Normal ALS render but to cubemap -> project from the cubemap to > screen. > > I'd guess that this has to be some sort of shader. > > The values of the cubemap can be accessed by a vec3 so > I'd probably need to write a function that looks up the texel > on the cubemap based on the screen pixel. > > But still... first I need to understand where those shaders are > called, when not done in the effect tag. I'd create a quad pass that receives the rendered scene and that has a Effect applied to it. Something like: <pass> <type>quad</pass> <effect>Effects/fullscreen/fancy-cubemap-effect</effect> <binding> <buffer>color</buffer> <unit>0</unit> </binding> </pass> Then in fancy-cubemap-effect.eff you can create a technique, a pass and a shader program that runs the shader you need. Fernando |