NikolaiVChr / flightgear-saab-ja-37-viggen

Saab 37 Viggen for Flightgear flight simulator
http://wiki.flightgear.org/Saab_37_Viggen
GNU General Public License v2.0
26 stars 15 forks source link

Fix shaders with Compositor (again) #122

Closed colingeniet closed 3 years ago

colingeniet commented 4 years ago

The following is all using the compositor branch rebased on master, and a recent (april 2020) compositor build. The default compositor pipeline works fine.

With the als pipeline, I get this: fgfs-20200423091105 fgfs-20200423091114

But it get interesting when tilting the camera up: fgfs-20200423091205

It seems the shaders are not completely broken (as in they are rendering something). Notice how in the last picture the hull is a bit transparent, and fades away when the clouds are behind. It looks like the aircraft is rendered in the background, so probably something broken with z-values?

colingeniet commented 4 years ago

Forgot to mention, of course I did not get any error message in the console, or I would have posted it.

colingeniet commented 4 years ago

After 5 minutes of research, it obviously is a z-buffer issue, since Compositor was changed to use logarithmic z-buffer in shaders.

NikolaiVChr commented 4 years ago

I will fix that when 2020.1.1 comes out.

colingeniet commented 4 years ago

Fixed the logarithmic depth in branch compositor2. Now the real problems become visible: fgfs-20200430082511

colingeniet commented 4 years ago

To fix:

To insist, tests are required with at least every combination of the following parameters:

NikolaiVChr commented 4 years ago

What external lights? landing/taxi or the others?

/sim/rendering/shaders/skydome will probably be fixed by Icecode so it can be used again. Think its a bug that it cant be used now.

Fuselage shader needs reordering of techniques, since model-combined was reordered.

colingeniet commented 4 years ago

What external lights? landing/taxi or the others?

Only landing/taxi indeed

/sim/rendering/shaders/skydome will probably be fixed

Good to know. It should be tied to the pipeline used by the compositor?

Fuselage shader needs reordering of techniques, since model-combined was reordered.

Thanks, this fixes the fuselage being broken on low-spec with shaders off. I will check if other inherited effects need the same.

colingeniet commented 4 years ago

Gamma correction is done higher up in the file now. With this line it appears you do gamma correction twice.

That sure didn't help. I blame git rebase for the duplication, and myself for not checking the diff.

colingeniet commented 3 years ago

Closing as it is no longer relevant. Compositor is now merged on next, and has very good backward compatibility. Also it currently does not include clustered shading, which was the source of the checkerboard issue.

The only changes that will be needed is to add shadows to the fuselage shader.