c172p-team / c172p

A high detailed version of the Cessna 172P aircraft for FlightGear
GNU General Public License v2.0
79 stars 44 forks source link

Improve our lights #633

Closed gilbertohasnofb closed 8 years ago

gilbertohasnofb commented 8 years ago

Improve our lights using https://github.com/HHS81/c182 as reference. That plane's lights are not only smaller and more realistic, but they also fade away depending on the angle (e.g. starting at the landing lights head on makes it be seen at its brightest, and then it fades when the camera moves away).

lights

To be done

rename texture transparent2.png to lights.png and also in the .ac model (main and damage models)

wkitty42 commented 8 years ago

will this also take care of the 2D(?) flashers on the wing tips and the 2D(?) landing light? i note, also, that there is no light showing on the wing or under the engine when the taxi light is on... that needs to be fixed, too...

gilbertohasnofb commented 8 years ago

Yes, the 182 has better flashing lights as well (the red one in that image is a flashing light).

gilbertohasnofb commented 8 years ago

I pushed the better light textures to a new branch bug-633, but the angle of the lights has to be done somehow in Blender (as I see that the only references to the lights in the 182 repository is in the .ac model). Can anyone have a look at it, maybe @wlbragg?

Also, I renamed our light texture from the meaningless transparent2.png to the meaningful lights.png, but I did this only to the .ac Model and the .png file and this has to be done also in the Blender file (which I don't dare to touch myself).

Finally, the sizes of the lights have to be reconsidered I think. The strobes in the wing tips are too large IMO, and also I can see some "squareness" around the flashing lights which we can try to solve, see:

fgfs-screen-003

fgfs-screen-004

gilbertohasnofb commented 8 years ago

I added some check points in the first post of this issue so we can keep track of what has to be done, ok?

wkitty42 commented 8 years ago

on the taxi light check point, i'm not sure if our craft is supposed to have the taxi light up on the wing with the landing light (slightly smaller with a slightly downward angle like low beams on a car??) or if it should go in that square space under the engine or if it is supposed to be on the front steering gear... i'm pretty sure that i've seen pics of all three placements but have no idea of the craft's years or if these might be modifications of some sort...

gilbertohasnofb commented 8 years ago

@wkitty42 I think you may be right, I think the taxi light is in the wing as well.

wlbragg commented 8 years ago

I can see some "squareness" around the flashing lights which we can try to solve,

@gilbertohasnofb the "squareness" strobe light pictures in pic1 and pic2 appear to be different as in the one in pic 1 shows the square fairly vividly where as the pic2 looks better. Did you do something already to correct it or is the green line just hiding the edge?

wlbragg commented 8 years ago

After comparing the two sets of lights I guess I am not convinced that the new lights are better than the old ones. What makes them better? translights

gilbertohasnofb commented 8 years ago

I am not convinced that the new lights are better than the old ones. What makes them better?

Well, it might be a matter of taste in the end, though I hoped this wouldn't be the case. Basically our lights currently look like explosions and I always thought they look plain ugly but never attempted to improve them myself. In RL lights are simple points of light and any effect trying to make it look like a star is actually trying to emulate how cameras see them (in photography and film, they often have a star shape, but never with the naked eye). This is the difference in the sim, and to my eyes the difference is like night and day:

fgfs-screen-002

the "squareness" strobe light pictures in pic1 and pic2 appear to be different as in the one in pic 1 shows the square fairly vividly where as the pic2 looks better. Did you do something already to correct it or is the green line just hiding the edge?

You are a bit confusing with the labels pic1 and pic2 and I really don't understand what you mean exactly :smiley: But the squareness of the lights seem to be identical to me in all pictures I posted except, of course, for the image of the Cessna 182 :wink: And no, I didn't do any work on it at all, all I did so far was to copy the new texture and apply it to the .ac models (and not to the Blender files).

wkitty42 commented 8 years ago

are these lights actual 3D models or are they 2D images (textures?) being applied to something? is it possible to do something like the rotating airport locater beacon lights? we don't need the beam that swings around but having the light to start dim and then get real bright and go back to dim with the coloring added to it would seem to be the thing... or am i maybe seeing another rendering trick being done with those airport locater light beacons?

gilbertohasnofb commented 8 years ago

They are just 2D textures applied to a 3D plane.

is it possible to do something like the rotating airport locater beacon lights?

I honestly don't know, but thinking about it the effect would probably look quite bad since if we rotate the plane in which the texture is applied, the light circle would get very disproportional close to the points where it disappear (see image below). In RL, the effect you see from a fixed point of view isn't really of a rotating light but rather of a light point first strengthening into the max then dimming out.

example

wkitty42 commented 8 years ago

right... i'm looking at maybe being able to not be faking it by using textures... that's why i asked about doing something like the airport rotating beacon lights... without the rotating, of course... just a colored light that goes from dim to bright at some cadence and looks the same from all vantage points up to certain angles where we don't see the light itself any more but some of the effects like the flash of the light lighting the surrounding area...

if the airport beacon lights that i've seen are like the images you show, them i'm confused as to how i see them easily when i'm moving about... there are a few that i've seen that do have visible beams, too... schiphol, maybe? and KSFO seems to have at least one that simply blinks and doesn't exhibit the rotating beam effect...

again, though, that's another reason why i asked if these were rendering tricks using 2D images/textures instead of real (as real as can be) lighting effects... and i guess that's the real question i was trying to ask... can't we do this with real lighting effects instead of faking it with 2D textures? are the blue and green taxi way lights just 2D textures? what about the white and red runway lights? i'm just brainstorming trying to explain what i'm seeing in my mind's eye but i'm lacking in the terms i guess... if we have to use a 2D texture, use it as the dim portion of the light then use the effect, whatever it is, to lighten that texture and the surrounding area till it is extremely bright like a disco strobe light and then dim it back down... brightening and dimming being very fast... then the tail or body mounted rotating beacons might use the same rotating beam effect that i see on that airport light beacon...

i just loaded at schiphol (EHAM) and ended up on RWY24... i'm in the UFO and set the time to dusk... if i rotate to a true heading of about 310 degrees, there is a beacon flashing way out in front of me... it appears to be over beside RWY18R/36L so i've flown over to it... it looks to be the same or similar to what i saw before where ever i saw it... either way, there was a beam sweeping around at an airport and i was like, "wow! that's a great effect. maybe that could be used on craft lights?" and so now here we are discussing it :wink:

gilbertohasnofb commented 8 years ago

can't we do this with real lighting effects instead of faking it with 2D textures

I think FlightGear can only have true lights under Rembrandt, which is obsolete and not under development since a long time (and it is also a hog on most systems and looks much worse than ALS even though it has some merits). ALS is all about "faking" things and that doesn't bother me the least. For instance, our landing lights in the runway are not made by a light cone either but it's rather a single texture projected on the runway. Check Thorsten's posts in the forum if you want to know more about this all.

Maybe there is a way of faking what you want, but as always it is is a matter of effort vs. results. I personally think there's very little gain to it.

Anyway, let's please focus on this issue that I opened which is about the new light textures that are already copied to the branch as well as implementing the fading according to angle which is certainly possible given that the 182 model has it, and trust me, the effect is wonderful.

wkitty42 commented 8 years ago

On 12/27/2015 11:30 AM, Gilberto Agostinho wrote:

Anyway, let's please focus on this issue that I opened which is about the new light textures that are already copied to the branch as well as implementing the fading according to angle which is certainly possible given that the 182 model has it, and trust me, the effect is wonderful.

i have no problem with that... i was just thinking that if we were going to improve the lights, we might as well go as far as we could and ""try to do it right"" but i think i see what you mean...

speaking for myself, i like the new stuff you propose... certainly better than that white diamond light splash thing we have for the wing mounted landing light now :wink:

gilbertohasnofb commented 8 years ago

:smile: :+1:

wlbragg commented 8 years ago

Sorry @gilbertohasnofb I was referring to this this The one on the right (pic2) looks like it doesn't have the noticeable square edge, but that may be because the green border is hiding it.

trying to make it look like a star is actually trying to emulate how cameras see them (in photography and film, they often have a star shape, but never with the naked eye)

Funny, my son said the same thing regarding the two different lights and was in agreement with your observation of which is better. I guess I happen to like the star effect but if it isn't reality then so be it. I would like to reduce the size of the transparent hole in the center of the new texture though, I think they are too big. If we could make it smaller as in the size of the center hole in the star textures I think it would be better.

I already changed the texture name in the blend but didn't push it yet. I need to look at the UV mapping because the new texture lights are not in the same position as the old ones.

gilbertohasnofb commented 8 years ago

The one on the right (pic2) looks like it doesn't have the noticeable square edge, but that may be because the green border is hiding it.

Yeah, that's an optical illusion, our eyes compare colours with the surroundings rather than analyse them in absolute terms. E.g.:

Above, both A and B have the same RGB values :scream:

Funny, my son said the same thing regarding the two different lights and was in agreement with your observation of which is better. I guess I happen to like the star effect but if it isn't reality then so be it.

You have a wise and tasteful son :wink:

I would like to reduce the size of the transparent hole in the center of the new texture though, I think they are too big. If we could make it smaller as in the size of the center hole in the star textures I think it would be better.

The hole in the centre isn't really that big, the texture is double the resolution as before so when you superimpose them you forgot to resize it. Also, there is a lot of information in the alpha channel which can't be seen very easily. This is the effective size of the lights (by removing the alpha channel of the light spots):

lights-no-alpha

As you see, not so much room to resize these textures. My suggestion is to simply leave it as it is.

I already changed the texture name in the blend but didn't push it yet. I need to look at the UV mapping because the new texture lights are not in the same position as the old ones.

I think they are, actually, but let's double check it. And when you push something to this branch please tick the boxes in the first post so we know what's missing, ok?

Thanks a lot!!

HHS81 commented 8 years ago

Light on the C182S and Dornier 328 has been done by using Gimp --> Filters --> Light and Shadows --> Supernova with no beams. I used a layermask with a radiant color gradient to get rid of the square edge. I used the flash animation (used on the airport beacon as well) since the navlights are only visible under certain angles.

gilbertohasnofb commented 8 years ago

@HHS81 Yes, I like your light texture quite a lot, it was one of the first features of the c182s that made me think "wow" :wink:

onox commented 8 years ago

@gilbertohasnofb It's not really nice to modify .ac files, because these files are generated. Shall I make a backup of lights.png, update the branch to be up-to-date with master, and then copy the backup to transparent2.png?

gilbertohasnofb commented 8 years ago

It's not really nice to modify .ac files, because these files are generated.

Ok.

Shall I make a backup of lights.png, update the branch to be up-to-date with master, and then copy the backup to transparent2.png?

Sounds good.

onox commented 8 years ago

@gilbertohasnofb If you do git merge-base bug-633 master. What does it say?

onox commented 8 years ago

ddbb3276fd673f74dee7bb0c189ffadd40178033?

onox commented 8 years ago

Anyway, it should. So when you're done with other issues, switch to bug-633 and do git reset --hard HEAD~2 and then git pull.

gilbertohasnofb commented 8 years ago

It doesn't say that, it says:

git merge-base bug-633 master
b299f860c39d11b06c5bdd810b7249e8008b63a5
gilbertohasnofb commented 8 years ago

Before that I did:

gilberto@gilberto-Inspiron-7520 ~/WorkingFG/c172p/c172p $ git reset --hard HEAD~2
HEAD is now at ddbb327 Merge pull request #631 from Juanvvc/bug-627
gilberto@gilberto-Inspiron-7520 ~/WorkingFG/c172p/c172p $ git pull
onox commented 8 years ago

I was assuming you did git merge-base before you did git reset. b299f860c39d11b06c5bdd810b7249e8008b63a5 is indeed the new common ancestor :+1:

gilbertohasnofb commented 8 years ago

Ok!

onox commented 8 years ago

The strobes are squarish :sob:

gilbertohasnofb commented 8 years ago

you mean like the the pictures I posted above?

onox commented 8 years ago

Yes. Is the UV mapping incorrect or something?

gilbertohasnofb commented 8 years ago

That's the thing, nothing has been done in the Blender file yet. I simply copied the better lights from the 182, but now we have to adjust it to our model. It's part of the work that has to be done on this issue.

gilbertohasnofb commented 8 years ago

see my first post for the TODO list :wink:

onox commented 8 years ago

@wlbragg The new Model/c172p.ac generates following warnings:

Could not find at least one of the following objects for animation: 'LandingLightCone'
Could not find at least one of the following objects for animation: 'TaxiLightCone'

I think it can be solved by just enabling the two objects in Blender before you export the file next time.

wlbragg commented 8 years ago

Yes, dang it, my fault, I had them turned off in that last commit.

onox commented 8 years ago

@wlbragg Would you be able to make the necessary modifications in Blender?

@gilbertohasnofb Could we just copy the light objects from the c182 Blender file? Its lights look great.

wlbragg commented 8 years ago

I'll see if I can get to this tomorrow.

onox commented 8 years ago

:+1:

gilbertohasnofb commented 8 years ago

Could we just copy the light objects from the c182 Blender file? Its lights look great.

Yes, I think we can do that. But notice that Heiko has also programmed the angles in which the lights are visible, but I have no idea how that works. Also this issue here isn't fixed yet, though he wrote me that the new model will probably have it fixed (should be pushed in the next days): https://github.com/HHS81/c182/issues/17

wlbragg commented 8 years ago

I pushed what I was capable of doing. I'm not happy with the landinglight object.

onox commented 8 years ago

@wlbragg Have you fixed the light cones and some material error in this branch as well? I have merged your changes in PR #669, but as you know, git cannot create diffs of binary files, so there's a risk that you may undo fixes from other branches.

wlbragg commented 8 years ago

Sorry about that, yes this contains both the material correction and the cones corrections. Please test and notice the Non-ALS landing light, view from external front with landing and taxi lights on..

onox commented 8 years ago

Lights look better, landing light could be improved in the future, but is good enough for now. Are there any boxes you can tick in https://github.com/Juanvvc/c172p-detailed/issues/633#issue-123902153?

add taxi light to right wing, together with landing light (but weaker and pointing downwards)

@gilbertohasnofb Could you elaborate? Aren't the lights on the left wing in RL? (On which they already are in the 3D model)

wlbragg commented 8 years ago

I'd like @gilbertohasnofb to take a look and see if he can eliminate anymore checkboxes because I'm just not sure if I satisfied any of them. The viewing angle does have influence on what we see, but I don't know if it is what he's talking about.

Another thing, the "Easter egg" pennies we're discovered to be missing their texture, like everything else, from the move to dev. I discovered this just now and it isn't a simple fix to put a square edit selection over a round penny texture. So all of the pennies would have a untextured white square around them, I hid them for now!

Also just added the seat mounts from the c182. Per your suggestion I added it to this PR. Can we combined the two issues here? Like you said, working on the blend gets complicated when you start spreading it out in different commits. seat @gilbertohasnofb it would make it a lot easier for me to texture the seat mounts if you can match a NEW texture in place of the old seat mount texture using the template in this image!

onox commented 8 years ago

We still had those pennies in the cabin? I thought they were removed a long time ago :open_mouth:

onox commented 8 years ago

Did you copy just the mounts or the seats as well?

gilbertohasnofb commented 8 years ago

@onox

add taxi light to right wing, together with landing light (but weaker and pointing downwards)

@gilbertohasnofb Could you elaborate? Aren't the lights on the left wing in RL? (On which they already are in the 3D model)

Sorry, meant left wing of course. Fixed int he list.

@wlbragg

I'd like @gilbertohasnofb to take a look and see if he can eliminate anymore checkboxes because I'm just not sure if I satisfied any of them.

All the checkboxes left involve Blender so I don't think I am the right person to tick them. If you feel something has been fixed, go for it!

The viewing angle does have influence on what we see, but I don't know if it is what he's talking about.

It's hard to explain but easy to see. Would you mind taking the c182 for a flight? Do this: in the external view, with all lights on, spin around the plane. Notice how the strength of the lights is angle dependent and how the effect looks realistic (it almost makes me believe ALS is rendering true lights!).

the "Easter egg" pennies [...] So all of the pennies would have a untextured white square around them, I hid them for now!

I always hated them, so they are better hid or deleted IMO! :smile: But why the hell they are untexturized? Is it a texture or UV-map problem?

Also just added the seat mounts from the c182

Great!

it would make it a lot easier for me to texture the seat mounts if you can match a NEW texture in place of the old seat mount texture using the template in this image!

I will take care of it today, ok?

gilbertohasnofb commented 8 years ago

@wlbragg I need to know exactly where the seat mount will be in the texture file. Would you be able to export that image of the texture file + the orange overlay of the 3D mount object into a 1024x1024 or 2048x2048 file? This way it would be trivial for me to match the positions. Using your image above would be a huge headache, as I have to manually guess the scaling and try to match it to the texture file for reference.

wlbragg commented 8 years ago

Would you be able to export that image of the texture file + the orange overlay of the 3D mount object into a 1024x1024 or 2048x2048 file?

I'll see what I can do.

But why the hell they are untexturized? Is it a texture or UV-map problem?

I think when we moved the blend to /dev/. I went back into the blend and remade all the paths to the textures but didn't know or see the pennies, so I saw them yesterday and when I remade their paths they were all screwed up. There must be a secret to it. The pennies on the texture.png are surrounded by white yet the UV map is a square because the pennies are a square object or plane, which leaves a white border around the pennies. I really didn't feel much like figuring out how to fix it as it is nothing that is useful to us.

wlbragg commented 8 years ago

Did you copy just the mounts or the seats as well?

I just copied the mounts. Did we want the seats? The seat and mounts were all one piece, it required a technique to split them apart, then another on to separate the left and right seat mounts and sizing that to fit the tracks. Not as simple as it might appear.