c172p-team / c172p

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

Exterior fuselage shading issue #1143

Open legoboyvdlp opened 6 years ago

legoboyvdlp commented 6 years ago

I noticed a few shading artifacts: notice the visible lines that I circled image image image

I'm not so sure about whether one of the things I circled is an issue or not, so I put a question mark beside it

gilbertohasnofb commented 6 years ago

@legoboyvdlp I believe those are mesh problems, but @wlbragg did once mention these sort of things are very tricky to fix. I will let him decide if there is anything to be done about it or not.

gilbertohasnofb commented 6 years ago

@legoboyvdlp This is definitely due to mesh, see:

image image

wlbragg commented 6 years ago

Yes and it is so difficult to fix that and not mess something else up. I am pretty sure I actually worked on that area already and that was as good as I was going to get it. I'm taking another look at it now. I'll report back shortly.

wlbragg commented 6 years ago

I'm going to make more of a mess than solve if I start cutting mesh to try to remove the abnormalities. Maybe when I learn more I might be able to clean something like that up but not now. the baggage area is another area that is a mess.

gilbertohasnofb commented 5 years ago

@wlbragg Should we change the label of this issue for 'Future release' or do you plan to take a look at this still for this release?

wlbragg commented 5 years ago

Yes, change it to 'Future release'.

gilbertohasnofb commented 5 years ago

For future generations: if you are reading this in 10 years time, good luck with this issue! :rofl:

legoboyvdlp commented 5 years ago

These shading issues are characteristic of so-called n-gons. Essentially the renderer can't figure out what direction the face is pointing as n-gons have more than four vertices so it can't figure out the normal. The best method to solve it is really the knife tool to split these -- its a bit of hard work but definitely worth looking at for future releases. I'm somewhat proficient with Blender now so if you like I can take a shot at it if nobody is working on the mesh in the near future.

I would need to know what ac3d exporter to use though as that can and has caused issues especially with materials when people use different exporters

Tris are slightly faster to render than quads it seems, but still can have shading issues.

I know that its a bit of a pain to do this -- but it really will be worth it :)

wkitty42 commented 5 years ago

@legoboyvdlp we distribute the ac3d import/export with the craft so everyone will have and use the same one we use...it is located in the c172p's base directory with the -set file...

legoboyvdlp commented 5 years ago

Thanks 💯

legoboyvdlp commented 5 years ago

After twenty minutes work:

image

I've cleaned up the door mesh, so far, and started cleaning up the area around the air conditioning flap (although causing a few other issues around it) Some un-needed vertices were actually removed on the door.

legoboyvdlp commented 5 years ago

And:

image

I think it's improved from: image

The door in particular; the air vent still has the artifacts but just not as prominently.

gilbertohasnofb commented 5 years ago

It definitely looks better in my opinion. I think this is a great moment to do this work since we are not currently doing any 3D modelling (that I am aware of), so there is no rush and we can go through the whole model. The panel in particular has some artefacts the bothered me, do you think you could take a look at those when you get a chance, lego?

Also, @wlbragg, do you think you can take a look at @legoboyvdlp 's work so far since you are much more knowledgeable in 3D modelling than me? Just to make sure that this is going in the right direction?

legoboyvdlp commented 5 years ago

Sure, if you can show me them I can take a look.

gilbertohasnofb commented 5 years ago

I will try to find the screenshots. They become very obvious at a very precise time of the day and heading from the sun. @wlbragg would you have any idea where I might have posted those screenshots? I don't think we ever opened an issue for that... was that maybe over the organization chat?

wlbragg commented 5 years ago

I just got back from my trip and will take a look. I need to refresh my memory as to all things c172p and make sure there is no open mesh work, I don't think there is. @legoboyvdlp did you try the ac import/export we have in the repository per @wkitty42 ?

legoboyvdlp commented 5 years ago

Hi, I did -- all looks fine now, I didn't notice any broken things!

Even if there is any open mesh work I'll probably want to start again anyway -- what I did there was just mostly an experiment to show how its possible to fix the issues; I'd like to redo it and see if its possible to do it with less vertices.

wkitty42 commented 5 years ago

remember, less vertices make for less rounded curves... there really is a trade off between having a stop sign and a circle even if the circle is really hundreds of straight lines :smile_cat:

wlbragg commented 5 years ago

Also, @wlbragg, do you think you can take a look at @legoboyvdlp 's work so far since you are much more knowledgeable in 3D modelling than me? Just to make sure that this is going in the right direction?

@gilbertohasnofb once @legoboyvdlp gets to a final PR version, I'll take a look. I have no doubt it can be cleaned up, it was simply more than I wanted to deal with, especially the liveries behind the mesh. After what I did to the nose cowling, wing tips, tail section and all the really big issues I noticed, I pretty much had my fill of mesh cleanup. I'm glad someone else can follow me up and get to some of the details. The entire fuselage could still stand a remake but we have come a long way from where we were!

legoboyvdlp commented 5 years ago

I don't think the last person who exported c172p.ac used our exporter

our exporter export_ac3d.py:

self.world = AC3D.World('Blender_export__' + bpy.path.basename(filepath), self.export_conf)

this one: https://github.com/NikolaiVChr/Blender-AC3D

self.world = AC3D.World('Blender_exporter_v' +str(operator.v_info[0])+"."+str(operator.v_info[1])+"__" + bpy.path.basename(filepath), self.export_conf)

our .ac has WORLD object name "Blender_exporter_v2.26__c172p.ac" while when I exported using our exporter I got Blender_export__c172p.ac.

since it looks like we actually use the one on NikolaiVChr's github based on the name of the exported .ac, I'll use that one.

gilbertohasnofb commented 5 years ago

The entire fuselage could still stand a remake but we have come a long way from where we were!

Absolutely! This model is light-years ahead of where it was just a couple of years ago!

image

image

wkitty42 commented 5 years ago

@legoboyvdlp might need to check with @wlbragg ? maybe he has an updated version? he's been the main one doing the .ac files AFAIK... at least the most prolific... if there is an updated version, it should be updated in the repo and fgdata...

legoboyvdlp commented 5 years ago

I used the exporter I linked and everything worked fine: no broken materials. When I used the one in my repo, all the materials broke.

wlbragg commented 5 years ago

@legoboyvdlp I am guilty of using different .ac's I'm sure at one time I used the one in the repo, since then I use whichever one I find that works across most of the different aircraft I am working on at the time. The Shuttle is really picky and needs a particular version. I have discovered the usual issues are Grouping, either it works or doesn't, and the way the materials are exported can be an issue, (as with the Shuttle) and the exporter you originally used. I too would just as soon keep up with NikolaiVChr's github based version if possible. I need to give it a go on the shuttle again and see if I can troubleshoot the issue it has with the Shuttle (materials) and have NikolaiVChr patch the latest version, or at least understand what the issue is. Whatever works correctly is fine with me. Anyone working on the mesh needs to be proficient enough to understand the import/export nuances which I'm sure your are.

wlbragg commented 5 years ago

Yes, @wkitty42 is technically correct, we should update the repo with the most current io script available that works.

legoboyvdlp commented 5 years ago

I think we'll keep this open, I'm not yet happy with the shading. But I don't think I'll have the time to do any more work unfortunately until this summer - probably July and August.