Upspring 1.54 - Page 10

Upspring 1.54

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Post by SpikedHelmet »

I love Upspring except for this one flaw. Worse still, I can't figure out what exactly causes it. I've tried and failed to duplicate it under controlled conditions. As far as I can tell it has something to do with saving the model.
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

Could Someone change UpSpring so that when replacing individual pieces it retains the original location?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

I'll spend some time on it, but keep in mind that i have another paid IT job that needs 16 hours/week and my actual study. And there are still bugs left from some upspring code refactoring...
User avatar
mehere101
Posts: 293
Joined: 15 Mar 2006, 02:38

Post by mehere101 »

Thanks, I don't expect you to drop everything for something so trivial.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Version 1.44:

http://user.supradigital.org/jcnossen/U ... r-1.44.exe


Changes for 1.44
----------------
- Rewritten the sloppy S3O texture handling. Hopefully this will result in less crashes (I think this was what spiked talked about)
- 3DS support rewritten using lib3ds
- A lot of internal refactoring of geometry code. This is needed to allow upspring to grow, but it might have caused a few bugs along the way.. Save your stuff a lot and please report all crashes.

Because of the internal changes the opk format is also changed, so < 1.44 files can't be loaded with this version.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Woo. :-)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Hmm. Did some tests... it still seems to be welding things it shouldn't. And all 3DS models now have to have "recalculate vertex normals" performed on them before they don't show up basically black. Which means, I think, that it's not reading vertex normals correctly from 3DS files... which also would explain why it's screwing up the welding.

Gonna have to find the old, old, OLD version of UpSpring, which didn't screw up my welding, and see if I can save it in .S3O just after import, then open it with the new version for editing pieces, and see what happens.

The turning/transform bugs are still present (i.e., turning a Piece past 180, or combining 180 with other turns, results in very odd problems).

The new "don't lose my position if cut/paste" rules, though, making it even easier to build a model from an import, and without all the annoying problems of having to re-move everything. If the problem with the normals was cured, this would be darn-near perfect- I can live with having to save between major turning transforms, but I'm finding it hard to live with mis-welded geometry. Overall, this is a very big improvement, it's just not getting stuff with big flat areas right, and "recalculate vertex normals" is making some rather strange stuff happen when I check it in Spring- surfaces that were getting nearly full-lit by the sun are now partially lit, and so forth, giving the models a less realistic look I think.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Can you test:

UpspringInstaller-1.45 WIP

Its work in progress.. I've removed all automatic mesh optimization, and added normal-checking for the manual optimization. You'll have to select optimize in the edit menu after loading from formats such as 3DS and OBJ

It has undo/redo support that is currently very slow during moving/rotating stuff because of a design flaw.
The turning/transform bugs are still present (i.e., turning a Piece past 180, or combining 180 with other turns, results in very odd problems).
Those are not bugs, its just converting between different forms of representing the same transformation.

Also please keep in mind that 3DS doesnt actually contain normals, it only contains smoothing groups, so it only loads normals(calculated from smoothing groups) when importing, and doesn't store them.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Will test immediately.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Well, on the one hand, now I can have models with razor-sharp edges again. Bravo.

But... that's the only good part.

After running a few tests, here are some definite results:

1. The smoothing groups are not being read from the model correctly- the resulting normals appear to all face straight up (+y, I guess) instead of their correct vectors.

If you're reading the normals from the smoothing groups, then I dunno what, exactly, is going wrong, but I end up with models that are "reflecting" light from above, but not from the sides. They look extremely weird in Spring when sitting next to everything else, because the lighting angle is obviously very, very wrong.

I can send you some screenshots if you need them to see what's happening. Just looking at the "view normals" view, I see some extremely strange things- normals that should all be facing straight out, because I darn well know I used a planar map... are instead facing at strange angles.

2. The texture location isn't being saved in the model any more. Caused a crash the first time, now I'm aware of it and can work around it, but it's still a bug.

3. What, exactly, does "Recalculate vertex normals" actually do? And why is hosing my welding completely, without fail, every time? It's like it just randomly re-welds stuff on its own, without checking for prior welding, and it doesn't seem to reference the normals generated during uvmapping, or anything else that makes sense. I'd use it if it ever did anything I wanted it to do, but it just seems to weld everything together. Which is not ideal.

Soooo...

I can have models that welded together, even when they shouldn't be, and they'll be lit correctly but have horrible welding flaws and no sharp edges.

I can have models with sharp edges, no welding, and that render incorrectly in the gameworld, but look less screwed-up in UpSpring because the lightsource travels with the camera, I suspect. Or maybe UpSpring is rendering differently from Spring again.

Or I can optimize the models, which doesn't seem to actually do anything, so far as I can see. I was hoping to see my welding re-appear, but without new welding appearing, but instead my imported models look like they're completely unwelded.

No matter which road I take, I have a model that looks terrible. This version rocks in many ways, JC, but there's something very fundamentally wrong with the 3DS import code still.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Did another experiment. Checked UpSpring's recorded vertex normal positions and vectors on imported models, before applying any optimization. There was absolutely no change in the number of normals. The smoothing groups are clearly getting ignored for some reason, and the welding that is intended to happen isn't actually happening.

So, here's a segment of my model, just after using the manual optimization. Every vert you're looking at, right here, should be welded, except for the verts at the bottom edge (we're looking at a foot here, and we want a nice, sharp edge on the bottom of the foot). However, this is what we see:

Image

To confirm my theory that Recalculate Vertex Normals is really just welding every vertice that is close enough to a common neighbor, and should be called something more useful, like "Weld", I then performed that step. Yup, every single vert is welded, whether or not the model's previous internal data was calling for it:

Image

So... yeah... the smoothing groups aren't ever being read. I dunno what's causing the weird lighting when in Spring, though. The shadows render correctly, so it's gotta be something wrong with the normals when the model is getting rendered that is causing this.
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

http://user.supradigital.org/jcnossen/U ... %20WIP.exe

One last attempt, if this doesnt work then there must be something wrong on the exporting side, because I'm already using the standard 3ds library that everyone uses (lib3ds.sf.net). I'll have to implement manual smoothing group creation within upspring if this doesnt work.

Recalc vertex normals definitely works, that's why it causes what you call "welding" (not welding is the same as having vertices with different normals on the same position).

2. The texture location isn't being saved in the model any more. Caused a crash the first time, now I'm aware of it and can work around it, but it's still a bug.
Can you explain that? I can't seem to duplicate the bug.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

You've got it!!! Imports now work perfectly. All verts are being welded/not-welded just as they should be. I have sharp corners and smooth curves. Wonderful!

However, there's definitely a remaining problem on the export side.

Whatever's being used to determine the direction that light is coming from is inverted on the X axis. So models are lit properly on the Z and Y axis, but not on X. I hope that's an easy fix, because it's the only thing that's a showstopper- the difference in quality that is going to result from this version is going to be nothing short of amazing, if you can get that fixed.

As for the texture bug... when saving the final model, UpSpring is no longer recording the texture directory, and every time I open up the models, it says it "cannot find texture blahblah". I then have to manually re-acquire the texture. If I fail to do so and then save, the model's texture is left blank, resulting in a crash. Not a huge deal, but probably easily fixed. And yes, this even occurs if I've already fed it my default texture directory :P

Lastly... there's one more bug, and it's a crash bug, so I should probably report it... if you import 3DS models and attempt to "Add Empty", UpSpring crashes immediately after assigning a name and hitting "Ok". Happens every time.
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

It happens to me as well, with 3SO models.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

What does? Please, be more specific when reporting remaining issues. :?
User avatar
quantum
Posts: 590
Joined: 19 Sep 2006, 22:48

Post by quantum »

This happens:
if you import 3DS models and attempt to "Add Empty", UpSpring crashes immediately after assigning a name and hitting "Ok". Happens every time.
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Post by LordMatt »

LOL quantum is a modder now. Who woulda thought? :shock:
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6241
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

Woo, imports now work correctly for me too, atleast with Rhino welding. 8) UU welding doesn't want to play ball, but it's probably my settings.
User avatar
rattle
Damned Developer
Posts: 8278
Joined: 01 Jun 2006, 13:15

Post by rattle »

Upspring seems to keep the smoothing from 3ds export out of wings as well. Although there were some oddities as some of my smoothing settings were entirely ignored while others weren't... any chance on getting .obj smoothing group support too?
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

Whatever's being used to determine the direction that light is coming from is inverted on the X axis. So models are lit properly on the Z and Y axis, but not on X. I hope that's an easy fix, because it's the only thing that's a showstopper- the difference in quality that is going to result from this version is going to be nothing short of amazing, if you can get that fixed.
I have one model saved on which that happened, only I don't know how and I can't duplicate it. Any ideas?

I updated
http://user.supradigital.org/jcnossen/U ... %20WIP.exe
with fixes for the crash on "add empty" and the texture path problems.
Although there were some oddities as some of my smoothing settings were entirely ignored while others weren't... any chance on getting .obj smoothing group support too?
I think I'm going to add internal smoothing groups support at some point, just for completeness.
Post Reply

Return to “Engine”