Jump to content
COMBATSIM Forum

007F-Canopy


DrKevDog
 Share

Recommended Posts

Gold%20Canopy1878009_zpshhdp8jos.jpg

I am continuing to work on upgrading the TAW and ADF F22 model . A previous discovery of the mysterious opcode 007F , which was never used in ADF or TAW, relieves much of the difficulty associated with the model building and/or modifications using the standard delta TAW opcodes. There are a number of modifications being worked on simultaneously and I thought I would share one of these just for fun.

I'm still experimenting with the standard TM textures for the canopy . There is a range of transparencies in the first row of the TAW palette . Some appear to work better for the new canopy than they did for the old one and it is coming along.

Old Canopy:

Canopy-deflt_zpsdulrkdpm.png

New:

F22Canopy-3D_zps0pnuhkoy.png

canopy-oblique_zpstd7svgjg.png

Canopy-side_zpsbmom7gck.png

canopy-front_zpsfxe1ghgm.png

I simply could not tolerate that angled canopy any longer :)

Link to comment
Share on other sites

Looking great! I was thinking about the yellowish taint for quite some while, until I realized you can only see it with white sky. With blue sky, the canopy is almost colorless, so I set it aside for now …

… one problem regarding the canopy is a very tricky instruction order which causes glitches in 3View and TFXplorer. You can observe it only with the open F-22 canopy and with one of the AH-64's rotor blades. I'd have to check, but in my memory it was something with offsets relative to vertices which were already transformed. If you change the canopy part of the F-22 anyway, it would be handy if you could either delete the glitchy polygons or re-order them to render O.K. with 3View :)

Furthermore, I was trying to implement the 007F opcode some time ago, but there were some logical problems so I gave up before wasting too much time. If an updated 3View was helpful to you, I could have another look.

Any further plans to improve polygon count apart from that? :)

Link to comment
Share on other sites

The yellowish taint is an actual layer of gold within the canopy and serves at least three
functions: radiation reflection, shading from the sun, and it also turns black to protect
the pilots eyes in the case of a nuclear blast. The canopy color variation, based on
environmental colour variances, may well be simulated in a shader (?). The last image (above)
reflects the 007C TAW Shader, I'm still playing with that feature. The indexed colour
limitation is a real one, however, using the 24 bit color 00A7/0047 opcodes via AGP is how I
intend to implement the yellowish taint (additive colour monster not withstanding).

Is this the glitch you are referring to? :

Hinge-glitch_zpsdnvd0ma9.png


An updated 3View would be most helpful. 007F and 002C are similar and although the functional difference between the two isn't completely understood, they seem to be extremely useful for simplifying the modification process.

Yes, improving polygon counts is a general mandate, unfortunately I am using Mikes old tools and therefore, progress is not very speedy, but ongoing and inevitable :)

Link to comment
Share on other sites

Is this the glitch you are referring to? :

Hinge-glitch_zpsdnvd0ma9.png

Exactly!

An updated 3View would be most helpful. 007F and 002C are similar and although the functional difference between the two isn't completely understood, they seem to be extremely useful for simplifying the modification process.

Alright, I'll start the analysis in two or three days (heavy workload here :( ).

Yes, improving polygon counts is a general mandate, unfortunately I am using Mikes old tools and therefore, progress is not very speedy, but ongoing and inevitable :)

Glad to hear the first part; not so glad about the "not very speedy" part; we'll see what we can do :D

Link to comment
Share on other sites

What is wrong with my old tool? :)

Yes, new tools are needed. I was thinking of cobbling something together from a simple open source 3D editor, some VB or Python glue code and then rendered by 3view. Unfortunately, thinking about it is as far as I've got. :(

What are you using to display the meshes above?

Link to comment
Share on other sites

Ah yes, AC3D has a nice test based file format for models making it particularly useful for experimentation.
That was from the pre-Krycztij days though, and we knöw so much more now. In fact I have no record of what I sent you from those dark days, so I'll need to search though my floppy disks.

I remember paying for an AC3D license, which seemed a better bet than getting to grips with the free but intimidating Blender.

Link to comment
Share on other sites

That was from the pre-Krycztij days though, and we knöw so much more now.

Yës wë dö! (SCNR ;) )

Ah yes, AC3D has a nice test based file format for models making it particularly useful for experimentation.

Oh yes, I remember this from my own experimentation back when I started computer programming. Oh, the old days. I think there are some old screenshots on photobucket, aren't there?

Link to comment
Share on other sites

Yës wë dö! (SCNR ;) )

Oh yes, I remember this from my own experimentation back when I started computer programming. Oh, the old days. I think there are some old screenshots on photobucket, aren't there?

I think we shöuld just have stuck with 7-Bit ÄSCII. :)

This is the first picture I uploaded to Photobucket. Must have been from about 2007.

tent1.jpg

..I suspect with a fair bit of manual intervention in parsing the .3 file in those days.

Link to comment
Share on other sites

Keep up the good work boys.  Great to see its still going.  I'm away (Bali for 6mths) but still follow your work with interest.  Unfortunately can't fly from here ...... but what's new ..... I never could, period  ...... ha!

Link to comment
Share on other sites

An updated 3View would be most helpful.

An important problem of mine comes to mind: vertex normals. TAW in some way computes vertex normals, and I have no clue how to do this. Flat lighting will be very ugly with the canopy.

Any ideas where the interpolated normals come from? Any patterns in the 3 files, e.g. "all triangles up to a 0000 call return statement are treated as one smooth continuous surface"?

007F and 002C are similar and although the functional difference between the two isn't completely understood, they seem to be extremely useful for simplifying the modification process.

Any clue what 002C does? In my code it's commented as "EF2000 only — used only in 'frigate2.3'".

Edited by Krycztij
Link to comment
Share on other sites

Not sure about surface normals and that's why 007F / 002C are so curious.

002C is much like 007F, however it is different in that it can write multiple vertex positions, like the following:

002c00100000fff6ffec0014
0000
fff6ffecffec
0000
ffceffecffec
0000
ffceffec0014
0000
ffce00140014
0000
ffce0014ffec
0000
fff60014ffec
0000
fff600140014
0000
003200140014
0000
0032ffec0014
0000
000affec0014
0000
000affecffec
0000
0032ffecffec
0000
00320014ffec
0000
000a0014ffec
0000
000a00140014
0000

That format is not in frigate.3, and does work in TAW, and there could be other interpretations.

Edited by DrKevDog
clarification
Link to comment
Share on other sites

Are you sure that TAW uses surface normals? My impression is that gouroud shading is used on 'curved' surfaces to get a nice lighting effect.

Take a look at this gallery for some examples: http://tailslide.firelightsoftware.com/taw.asp

In the 3rd picture, notice how dark the plane’s downside is:

TAW-gearup2.jpg

There is a sharp edge between the bright upside and the dark downside of the inlet ... but the nose has a very smooth color gradient (and so have the leading-edge flaps). This definitely is lighting with interpolated vertex normals. Moreover, it does have some additional information (or else, the intake edge wouldn't be as sharp as it is).

P.S: On DKD’s screenshots on top of the page, you can see the fine color gradient on the cockpit canopy. It seems to depend on the plane's rotation, so it's definitely interpolated vertex normals with Gouraud Shading, or some Phong stuff.

The thing is, .3 files draw triangles one by one. I don't know two triangles share an edge (and their normals!) until the last triangle is drawn. Pretty wicked. If there were some structure, e.g. "just gather triangles instead of drawing them, and at 0000 call return, compute vertex normals and actually draw everything" I could implement it. But I can't spot anything.

The canopy drawing is more complicated than I expected, too — the transparent and solid parts are on the same triangle and just use different textures. Just changing texture color is not enough; I need to write a shader for that :(

Link to comment
Share on other sites

 

The canopy drawing is more complicated than I expected, too — the transparent and solid parts are on the same triangle and just use different textures. Just changing texture color is not enough; I need to write a shader for that :(

I thought the transparent and solid parts also used a different draw call:

Example:

004700060003005E00B1007C00B1007C00BF00880003006300F300C2 (transparent)

004700480003000000000004001800000018008E0003006300F300C2 (solid-mask)

Note the solid orange canopy base:canopy2_zpsw0wt3ccf.jpg

canopy3_zpsqxih0xpy.jpg

Link to comment
Share on other sites

The orange canopy base is what I mean. The shader must filter pixels by alpha (full opacity = canopy base; don't change color; little opacity = canopy; change color).

Here's my take:

2015-10-24_canopy.thumb.gif.501f865e3599

It fails miserably with an open canopy, though. Going to check the cause …

Furthermore, one can see the individual faces because there's no Gouraud shading. When your canopy replacement is done, I'd be happy to get one for testing :)

Link to comment
Share on other sites

Got it. If I see correctly:

  • at that one time of day, the cockpit section has different painting
  • the canopy texture has an orange taint
  • when opened, the old canopy is used

The good thing is, it doesn’t crash. The bad thing is, for some reason no canopy triangles are ever transformed. Debugging now.

Edit: Two issues:

  1. I suspect you never call 0061 <number> <offset> to transform your canopy vertices. Actually, I'm amazed TAW accepts this, and it makes me wonder whether 0061 may have a different meaning than "transform".
  2. The Z order is wrong; it draws the canopy first and the rest of the plane after. This makes it hard for me to analyze the canopy (it's constantly being overdrawn).
Link to comment
Share on other sites

I haven't looked at .3 opcodes in any detail since 2011, but I'll try and catch up. :blink:

I'm looking at the possibility of using a AC3D plugin to help with this stuff, but have fallen at the first hurdle.

If anyone out there knows anything about Visual Studio, maybe they could tell me why my example plugin (basically a dll) functions are not visible by AC3D (or Dependency Walker). The compilation/linking process seems to go OK, but I'm obviously missing some setting.

 

Link to comment
Share on other sites

Thank you!

That part was being bypassed since this line from the SDK header was returning false:

#ifdef WINDOWS

Now, I'm am running Windows but VS doesn't seem to think so in this case. I probably should have started with something other than 'empty project'...

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...