viktorradnai / flightgear-ask21

ASK21 glider model for Flightgear
5 stars 6 forks source link

Realistic reflection shader #154

Closed HHS81 closed 6 years ago

HHS81 commented 6 years ago

This PR changes the appearence of the 3d-model to a higher realistic level:

-correct material settings of the 3d-exterior-model ask21.ac: "amb" has to be equal "rgb", otherwise colors and shading looks wrong. Unfortunately all ac3d-Blender exporter doesn't do this correct.

-changed cubemap of the reflection-shader: the one used doesn't match the usual environment shown in FlightGear.

-correct shader settings: the ASK21 is a glass-reinforced plastic glider - it isn't coated like a shiny sports car, the strength of the reflection was overdone. The real aircraft doesn't show any any rainbow colors or black stripes. So I changed the values to match the real ASK21s.

-glass-canopy: changed color to a more blueish color (as some real life images shows) and added a glass shader

Pictures (non-edited!): fgfs-screen-014 fgfs-screen-015 fgfs-screen-016 fgfs-screen-018 fgfs-screen-019

viktorradnai commented 6 years ago

@HHS81 Thanks for this. I only have three questions.

  1. With the new settings, at times the top surface of the glider appear to have a slight greenish tint. Is this because the surface incorrectly reflects "ambient" light reflected from the ground? Can anything be done about it?
  2. @D-ECHO Are the wing and fuselage still different materials? The wing seems to be a bit shinier despite having the same effect applied to it. Or maybe I was looking at it wrong :)
  3. Both the wing and fuselage appears to show some kind of pattern in the reflection when viewed at a shallow angle. Is that a texture or a flaw caused by the shader implementation?
HHS81 commented 6 years ago

@viktorradnai

With the new settings, at times the top surface of the glider appear to have a slight greenish tint. Is this because the surface incorrectly reflects "ambient" light reflected from the ground? Can anything be done about it?

What you actually see is not really the ground but the surrounding of the ground. Similar when you look at a lake, where you also see not only the sky but also the surrounding. That's correct, a similar effect you can see here The greenish tint comes from the shader-ambient correction setting. If you set the this value to 1.0 the whole aircraft appears green. If you set this to -1 the whole aircraft appears blue, the greenish dissapear. That's something inside the shader and I couldn't yet find out why and how to fix this. We can reduce the strength of the reflection-correction, if wanted.

@D-ECHO Are the wing and fuselage still different materials? The wing seems to be a bit shinier despite having the same effect applied to it. Or maybe I was looking at it wrong :)

Material of wings and fuselage are the same. I checked this. The wing is shinier due the fresnel-effect. You are usually not looking straight on the wings, but on the fuselages side. When you stand behind the aircraft you can see the fuselage looks shinier then from the side. All materials in real life has this fresnel-effect, even bricks. You can see this effect here.

Both the wing and fuselage appears to show some kind of pattern in the reflection when viewed at a shallow angle. Is that a texture or a flaw caused by the shader implementation?

The flaw is caused by the splitting of the wing model for the wing flex animation. It was visible with the current shader implementation as well. There is nothing we can do about.

viktorradnai commented 6 years ago

@HHS81 Thanks for the detailed explanation -- it's been a while since I played with these settings and forgot about the side-effect of ambient-correction. I would prefer turn it down from 0.15 to 0.1 and leave it at that. But we can merge it as is, and we can agree on a setting with @D-ECHO afterwards.

I'm happy for this to get merged and again, thanks for your contribution :)

ghost commented 6 years ago

Merged :D Thank you very much @HHS81

HHS81 commented 6 years ago

@D-ECHO Thanks you for the great improvements you all made to this aircraft. It is fun to fly! 😃