Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Tools => Topic started by: Spicious on July 06, 2010, 02:41:00 am
-
I've started on an insignia editor for PCS2. If you have suggestions for how you'd like it to work, post them here.
-
Ooh wow, that'd be awesome to see - good luck man. :)
My suggestion would be to make it as visual-based as possible. Perhaps do it like this: (from an end-user perspective)
1) Pick a projection vector (ie, the simple version would be [+/-] direction, [x,y,z] axis, but if possible any vector would be best) and a radii from which the locations of the verticies in the insignia polygons can be projected (ie, they get projected from that vector till they hit the hull)
2) Define a level of subdivision for the projected plane. Basically this would either be 0 or 1 where 0 means you get a two-polygon plane, and 1 means you get an eight-polygon plane. Each vertex of the plane is projected separately so the idea is the plane follows the contours of the hull at the specified area.
-
Keep it simple.
Have a choose poly, centre by default. Scale, rotate, flip normal. And XY adjustment.
That's all anyone will ever need :yes:
Also . . . . . . . . I love you.
-
Go Spicious Go!
-
1) Pick a projection vector (ie, the simple version would be [+/-] direction, [x,y,z] axis, but if possible any vector would be best) and a radii from which the locations of the verticies in the insignia polygons can be projected (ie, they get projected from that vector till they hit the hull)
2) Define a level of subdivision for the projected plane. Basically this would either be 0 or 1 where 0 means you get a two-polygon plane, and 1 means you get an eight-polygon plane. Each vertex of the plane is projected separately so the idea is the plane follows the contours of the hull at the specified area.
Interesting idea. Are you suggesting that it start with a square comprised of a predetermined set of triangles and then try to project each vertex onto the actual geometry? That seems like it'll rely on getting lucky with it not intersecting the mesh. Projecting onto a flattish surface might work I guess.
It's ready to try here. See link in sig.
-
That one there works and is a good start - nice dude! :D
However, due to the nature of the data involved it's definitely more of an insignia viewer than editor. Like you COULD try creating and manually placing insignia by numbers alone,.....but you wouldn't.
And yeah you've got the gist of the idea there. Individual insignia can only consist of 8 polygons max IIRC and because you want them to be square that means you'll typically only ever need a 2 poly plane (flat surfaces) or an 8 poly plane(for curved surfaces). Positioning them using the projection system well you could build in an auto offset from the hull surface so the insigina doesn't quite get stuck in the hull, or let the user specify one. Beyond that I'd imagine it would work so that if any vertex 'missed' the ship in the projection it would be placed where it intersects the bounding box along its vector.
Oh yeah - and you would need to be able to specify rotation around the projection axis. :)
-
That one there works and is a good start - nice dude! :D
However, due to the nature of the data involved it's definitely more of an insignia viewer than editor. Like you COULD try creating and manually placing insignia by numbers alone,.....but you wouldn't.
I would and have in the rather distant past.
And yeah you've got the gist of the idea there. Individual insignia can only consist of 8 polygons max IIRC and because you want them to be square that means you'll typically only ever need a 2 poly plane (flat surfaces) or an 8 poly plane(for curved surfaces). Positioning them using the projection system well you could build in an auto offset from the hull surface so the insigina doesn't quite get stuck in the hull, or let the user specify one. Beyond that I'd imagine it would work so that if any vertex 'missed' the ship in the projection it would be placed where it intersects the bounding box along its vector.
The max is 10 triangles and 20 vertices, although I'm sure it could be worked around by breaking it up into multiple insignia. I'm happy to go with letting the user ensure the surface is sufficiently flat.
The control for setting most of the projection parameters is done and provides a preview of sorts. It shows up if you have an insignia with no faces selected. Same url as before.
Incidentally, it seems the MediaVP Medusa insignia are backwards.
-
Vertex projection is working now. It can turn out pretty decently if positioned well.
[attachment deleted by ninja]
-
Probably a stupid question but does it allow for more then one insignia texture? Say put the squad on the wings and the pilot under the cockpit?
Can't even remember if the code supports this.
-
No; all insignia on a ship use the same texture.
-
Can I nitpick and ask you to pick a different texture for the demo; say, the 53rd Hammerheads? That has text on it so it's easy to tell if you have your normals flipped.
-
Everyone knows the 107th image faces to the right :p
-
It looks excellent, seems to be quite intuitive, easy to visualize and use. Great job.
-
Can I nitpick and ask you to pick a different texture for the demo; say, the 53rd Hammerheads? That has text on it so it's easy to tell if you have your normals flipped.
I'm not really happy with any of the stock or MediaVP insignia for the preview. Ideally it should be opaque at its border and have a clear indication of directions; looking nice would be a bonus. The Raven happened to be inside a circle which somewhat approaches the border requirement. The MediaVP version of the Hammerheads seems at least as good by those criteria.
-
And approach 2, using 62 triangles in this example...
[attachment deleted by ninja]
-
Wow, that's... that's REALLY good!
-
This could actually be useful for Wings now that I think of it. The tails of airplanes provide a nice large flat surface to put a squadron logo on, with little or no normal mapping on those areas to be ruined by the squadron logo.
-
many fighter squadrons tend to stick unit crests/logos/colours to the tail fins of their fighters
-
lets all remember now that insignia are always flat shaded, before we get to carried away.
-
lets all remember now that insignia are always flat shaded, before we get to carried away.
They used to be, back when they had no opacity. Now they're partially transparent, and they ought to be affected by mission lighting as normal.
-
Remember that they're limited to 10 triangles in game.
Would everyone be happy with just the second option?
-
As long as it works, . . . . It works :yes:
Now how does this work, is it a plugin or a new standalone build?
-
The previous link has been updated with the changes. It's a new build; I guess it'll get merged into the main branch after a bit of testing.
-
They used to be, back when they had no opacity. Now they're partially transparent, and they ought to be affected by mission lighting as normal.
except that has nothing to do with anything. insignia have normals defined on a per face basis, you need per vertex normals to allow anything other than flat shading. transparency has nothing to do with lighting. this is a data limitation, there is no way to fix it short of making a new separate insignia chunk.
-
That's freaking brilliant man. :D Awesome job!
4 things:
1) Minor issue - when you hit 'project' the displayed insignia doesn't change/update until you get out of the insignia editor and then go back to it.
2) Can we place the 'position' via the ctrl+mouse click dragging system used everywhere else in PCS2? I expect that's already something you planned to do but just in case! It would make placement much quicker and easier. :)
3) If you open a model that already has an insignia and add another one, you get the project button appearing on the new one, but none of the vector entry text boxes appear, and the button itself doesn't do anything (kinda obviously).
4) The subdivision option looks like it can make an insignia that has way more faces than the game allows (which I thought was 8 but 10 is better! Lets go with 10) so would it be possible to build that limitation in?
Oh and some nice default values that get an insignia projection plane displaying as soon as you enter projection mode would be awesome. :) Ie: Position: 0:10:0, Projection Vector: 0:-1:0, and....a reasonable subdivision value
But seriously wow - you've gone above and beyond, and I'm very impressed! :yes:
-
That's freaking brilliant man. :D Awesome job!
4 things:
1) Minor issue - when you hit 'project' the displayed insignia doesn't change/update until you get out of the insignia editor and then go back to it.
Changing the selected insignia/face/point should trigger an update. I may look into it at some point. The auto-generate paths buttons seems to work the same way.
2) Can we place the 'position' via the ctrl+mouse click dragging system used everywhere else in PCS2? I expect that's already something you planned to do but just in case! It would make placement much quicker and easier. :)
That should be doable, but getting everything to move with a centre point will take more digging.
3) If you open a model that already has an insignia and add another one, you get the project button appearing on the new one, but none of the vector entry text boxes appear, and the button itself doesn't do anything (kinda obviously).
Interesting; that doesn't happen for me. The button doesn't do anything if the values aren't valid.
4) The subdivision option looks like it can make an insignia that has way more faces than the game allows (which I thought was 8 but 10 is better! Lets go with 10) so would it be possible to build that limitation in?
The way it works is it more or less projects subdivision*subdivision (this probably needs renaming now) points inside the square onto the model and it includes all the first polygons hit, clipped to fit inside the square, and then shifted back by the back off value (in practice the polygons get projected onto the plane of the square but the result is equivalent). Changing the resolution will only change how likely it is to miss small polygons and how long it takes. The number of triangles is entirely dependent on the geometry so it's important to target well. A smallish bump in the limits would probably suffice for most cases.
Oh and some nice default values that get an insignia projection plane displaying as soon as you enter projection mode would be awesome. :) Ie: Position: 0:10:0, Projection Vector: 0:-1:0, and....a reasonable subdivision value
It's possible, but the default values would be completely arbitrary. The default subdivision value of 128 should work in essentially all circumstances where the insignia will fit into 10 or so triangles.
-
1 and 2 are done/fixed. 3 has been worked around.
Are there any other comments?
-
Ah so much better with the drag and drop positioning and instant feedback with the project button! Very very nice! :D
I'm still having trouble with the number of polygons it creates, but I can see how careful location selection would work. I just keep ending up with dozens and dozens of small triangles forming the overall insignia, even though the surface the insignia might be on is actually quite flat but has some extra edges (or worse, an unnecessary vert or two) across it.
Again though I'm so impressed by this. :D
-
I've got it merging approximately coplanar polygons with shared edges. The "approximately" may mean yet another fiddly option for picking the tolerance.
There would be pictures but the upload folder is full and I can't be bothered putting them somewhere else.
-
Well this isn't good. I just tried this out. Opened first .dae model, tried global input from existing pof, and it just locks up reading objects.
-
Insignia build updated with the change mentioned above. Please try it out!
Well this isn't good. I just tried this out. Opened first .dae model, tried global input from existing pof, and it just locks up reading objects.
Does it still happen if you save it as say pmf first and then try the import? Can it load the existing pof normally?
I can take a look if you provide me with the files.
-
Not entirely sure of what behaviour I'm looking for sorry? Pics would definitely help! :p
-
Before and after the change:
(http://mt.hard-light.net/spicious/before.jpg)(http://mt.hard-light.net/spicious/after.jpg)
-
Oh right! That would indeed be awesome - I shall test when I get home. :)
-
I've lost the link :nervous:
-
How did you lose Spicious' sig? :wtf:
-
Last time i got this ist was in a post, i don't tend to re-read sigs in all honesty.
Thanks for the indirect hint though. Mwah x :yes:
-
Awesome - seems to work quite nicely! Well done indeed! :D
The insig poly limits in FSO do still need to be bumped though - I'm still getting quite high counts on relatively flat surfaces that would be ideal for insignia that would obviously crash if the 11 poly limit is still in place. Would a bump be possible?
-
Merged into master.
-
Is it possible to add nameplates to big ships with this?
-
Interesting question. It would be the same geometry editing, but writing to a different chunk of POF data...
-
While it would be similar in terms of setup it would be one way and wouldn't really fit with the way in PCS2 that each editor corresponds to a chunk of the pmf format.