Patch questions

User support for JPatch

Patch questions

Postby dcuny » Fri Oct 21, 2005 1:47 am

I grabbed a low-resolution model of Raf Anzovin's "Dennis the Dog" model (actually, Raf calls it a "rudimentary proxy model") and imported it into JPatch.

A couple things I noticed:
  • A:M apparently allows 3 point patches. For example, have a look at the ears. How would this be done in JPatch, since (if I recall correctly) you're a lot more strict about what's an allowable patch?
  • I'm having trouble closing up the feet. If you look at the right foot, you can see I started closing up the bottom foot. The patches should be symmetric, but they aren't, because patches that exist on one side don't exist on the other. It looks like there's a 3-point patch there, but since that's disallowed by JPatch, I'm not entirely sure what's happening.
  • To rephrase the question: how should the foot be closed up?
Thanks! :)
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby sascha » Fri Oct 21, 2005 10:50 am

Some things have changed from 0.4 to 0.5, so the instructions below are only applicable to JPatch 0.5.1!

A:M apparently allows 3 point patches. For example, have a look at the ears. How would this be done in JPatch, since (if I recall correctly) you're a lot more strict about what's an allowable patch?

Jpatch allows 3-point patches as well, but you're right, JPatch is a bit more restrictive. And - as this example shows - for a very good reason. Even expirenced A:M users makes mistakes, and JPatch helps to spot those mistakes (which, if not corrected, would lead to problems during rendering).

First, let's look at the ears. They're not accepted as a patch, so obviously there's something wrong with them. The second hint JPatch gives you is the color of the controlpoints. Let's recap that: A yellow point means that this is a single controlpoint (i.e. there's only one curve going through this point). A red point means that this point is attached to one other point (i.e. there are exactly two curves crossing at this point, which is the normal case). A large orange point would mean that this point is attached to more than one other points (i.e. more than two curves cross at this point - which in many cases is not desired).
To make the implications of this more clear, select one "ear" (e.g. by selecting one controlpoint and pressing ENTER). Now change the tangent-mode to round by clicking on the round button in the mesh-toolbar.
Now it's quite obvious what's gone wrong: There are only two curves (one connecting the topmost points, and one goning through the bottom point), but JPatch's patch-finding-rules say that a 3-point patch must be made up of three "different" curves.
The problem isn't easy to see (the only hint is the yellow color of one of the controlpoints). That's why the "peak" mode shouldn't be used (or at least should only be used with care).
To correct this problem, hide the rest of the geometry (so that only the ears are visible). Now Delete the yellow controlpoint by selecting it and pressing DELETE (not BACKSPACE!!!).

Add the two missing curves again. JPatch has a new mode to make this easier. When adding the curves, hold down CONTROL - this will tell JPatch to not "append" the new curves to an existing one, but to "attach" the new curve. Be sure to be in "round tangents" mode, so you can see the difference. Try it without the CONTROL key down to see the difference.
After you've added the two curves again, pressing F5 should find the new patch (be sure to have show patchs on and backface-culling turned off).
You can also see that it's actually 3 different curves by selecting the ear and using the add-stubs tool from the popup menu (to remove the stubs again, use remove-stubs) - try this with the other (wrong) ear to see the difference.

Now, let's take a look at the feet. After carefully examining them you'll note that there in fact is a difference: There's a curve missing on the character's left foot (on the right screen-side in front-view). Let's take a look at the region on the right foot that covers the hole: It's made up of two 4-sided- and two 3-sided patches. The same-region would be filled by only two 4-sided patches on the left foot. Since these patches are made up of only 3 different curves, JPatch deems them invalid (in fact, they'll cause rendering artifacts because the patches are "degenerate" - i.e. the surface normal is not well defined for all points on the surface).
To correct it, select the center curve on the left foot (using the TAB key) and insert a new point (using the INSERT key). Now add the two curve segments (just as they are on the right foot). Running "compute patches" should find the (now valid) patches.

Right now it might be necessary to flip the patches (or use the align-patches tool), I'll try to improve the patchfinder to automatically align new patches.

To conclude: Both problems are caused by mistakes in modeling. It's just virtually impossible to spot these mistakes in A:M because it silently ignores them (their only manifestation will be complains about creases in the surface - the old A:M problem - and the A:M "solution" is to mask them out with the porcelain material... :? ).
JPatch on the other hand will force you to model correctly, or to correct errors in imported A:M models - and with a little practice it's IMHO easy to find and fix those problems.

JPatch's behavior is IMHO not a restriction. 3-, 4- and 5- sided patches as well as hooks are perfectly ok for JPatch. All it does is rejecting patches that are "simply wrong" and would cause problems during rendering anyway - and by doing this it helps spotting and correcting such problems.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby dcuny » Fri Oct 21, 2005 7:51 pm

Sascha wrote:Jpatch allows 3-point patches as well, but you're right, JPatch is a bit more restrictive.
I hadn't realized that. I really do need to re-read the documentation. Still, I like to try to see how much I can do without a manual. ;)

One of the reasons that the ears baffled me is that I'll typically select a point, and then use the Tab key to see what the connections are. For this model, there are a lot of "missing" curves.

Unfortunately, using the "Software 2D Renderer" makes it worse - there seem to be a lot of cases where the green line is masked by the white lines. (Turning off "Show Curves" will show the "missing" line). This seems to be less a problem with the "OpenGL Renderer".

To correct this problem, hide the rest of the geometry (so that only the ears are visible). Now Delete the yellow controlpoint by selecting it and pressing DELETE (not BACKSPACE!!!).
Here's a point (literally) where I run into trouble. If I delete the point, I no longer have a reference to the point that I want the line to go through. It might be nice if JPatch:
  • Showed the position of the point that was selected/moved, and
  • Allowed you to manually enter an x/y/z position for a point.
That way, I could make a note of the point's position, remove it, attach a new spline, and then manually enter the new position of the end point.

So I selected the ear, hid everything else, and reconstructed a new ear. I had a bit of difficulty with this. The first time, I accidentally welded points on the new ear to the old ear. The next time I managed to lock JPatch up, but I'm not sure how... :?

The last time, I created a new ear, and saved the selection as "New Ear". I then selected the "Old Ear" and tried to delete it by pressing the Delete key. No luck, so I tried the Backspace key. Still no luck, so this time I tried Delete button for the Selection (Yeah, I knew it wasn't going to work, but I was desperate).

That (obviously) didn't work, so I did an Undo. That brought back the selection onto the list, but almost immediately after, JPatch's screen rendering locked up (the rest of the app kept working, though).

I also noticed that after welding a point, you can't move it unless you select another point. I have a vague recollection about this being a feature I asked for, so you wouldn't accidentally move points while welding them, but I can't remember for sure.

If that is a feature, I think that it you should only lock it in place when the Middle Mouse button is pressed - a regular left-click should allow the point to be moved immediately.

Add the two missing curves again. JPatch has a new mode to make this easier. When adding the curves, hold down CONTROL - this will tell JPatch to not "append" the new curves to an existing one, but to "attach" the new curve.
This is very, very nice! :D

You can also see that it's actually 3 different curves by selecting the ear and using the add-stubs tool from the popup menu (to remove the stubs again, use remove-stubs) - try this with the other (wrong) ear to see the difference.
Ooooh. Another nice addition. :D

Once I get the ear fixed, I'll get back to you about the foot. Thanks!
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby sascha » Fri Oct 21, 2005 8:23 pm

All the edits (the code that actually manipulates the model and provides undo/redo support) have either been refactored or re-written from scratch in JPatch 0.5.1. I wouldn't be surprised if they'd have more bugs than the old code (the difference is that finding and fixing the bugs should be a lot easier now).
I'll have a look - if you run into a bug, please try to reproduce it and let me know. Once I can reproduce it it should be easy to fix.

Not rendering the green line (selected curve segment) could be a bug in the software renderer (like checking for less (<) instead of less-or-equal (<=) when doing the depth-buffer test). I'll have a look.

The reason why I said don't use backspace in this particular case you've got two splines and three points:
Spline A goes form point 1 to point 3
Splint B goes from point 1* to point 2 to point 3*
(* It actually goes from point 4 to point 2 to point 5, where 4 is attached to 1 and 5 is attached to 3, but this doesn't matter here).
Now when you REMOVE (backspace) point 2, you'll end up with two coincident splines. I'll have to check for such situations and remove the coincident splines automatically - this will avoid a lot of confusion.

The difference between remove (backspace) and delete (yes, delete key) is that remove will remove the point form the spline, but delete will "open" that spline. In the case of removing the center point form a 3-point spline, the entire spline will be removed.


:shock: Wait a moment. Oops. I just tried a few things and discovered that there are some horrible bugs in version 0.5.1 - ok, for the time being, forget the new features and use vesion 0.4 please :-(

Here's a point (literally) where I run into trouble. If I delete the point, I no longer have a reference to the point that I want the line to go through. It might be nice if JPatch:

Sorry, my fault. Of course you don't have to remove both segments. Here's how you can fix the ear in JPatch 0.5:
Image
1) Select one segment and delete it
2) Attach a new segment (by using the CONTROL key)
Here's how you can do it in JPatch 0.4:
Image
1) Select one segment and delete it
2) Manually append the "stubs"
3) Add the missing segment
4) delete the stubs

I also noticed that after welding a point, you can't move it unless you select another point.

:oops: A bug!

Ok, I'm gonna start Eclipse and try to fix those bugs :?
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby pndragon » Fri Oct 21, 2005 8:26 pm

there seem to be a lot of cases where the green line is masked by the white lines. (Turning off "Show Curves" will show the "missing" line). This seems to be less a problem with the "OpenGL Renderer".

The OpenGL renderer doesn't not seem to want to highlight the curves in color while the patches are turned on - it seems to use various shades of gray. Turn off "Show Patches" color is restored.

--- Jim
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina

Postby sascha » Fri Oct 21, 2005 8:32 pm

The OpenGL renderer doesn't not seem to want to highlight the curves in color while the patches are turned on

Yes. Seems that the highlighted green lines are rendered after the patches - and that JPatch doesn't turn off lighting after rendering the patches (this causes GL to ignore the color but use the material-properties and lighting setup to compute the colors). If you turn off lighting the problem is gone...
Thanks for reporting that, will be fixed.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby dcuny » Fri Oct 21, 2005 9:10 pm

The pictures really help a lot! I hope you're saving them somewhere for the manual. :D

Here's the problem I ran into when I tried what you suggested - I should have reported it earlier: when I delete the segment, the end point disappears:

Image

I had assumed this was happening because there might have been a glitch in how the data was imported, so I ignored it at the time, and tried a different approach.
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby sascha » Fri Oct 21, 2005 9:25 pm

No, A:M import and .jpt file reading should be fine. I ran into a quite similar problem - looks like some bug in the delete edit :?

Until they're fixed, please use JPatch 0.4 for serious work. I guess I've seen enough bugs in 0.5.1 for now :wink:

Sorry about that - but as the title says - it's a development version. I wouldn't say that version 0.4 is free of bugs - but from what I've seen now I think it's much more stable.
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby sascha » Fri Oct 21, 2005 9:38 pm

I'm working from the CVS. I think I've commited a few days ago, but I only worked on DOFs for bones - so I should neither have added nor removed any of the bugs described above - at least not intentionally :wink:

I guess I'll postpone that DOFs thing and try to get those bugs fixed first...
I'm pretty sure that it looks worse than it is.

---
Huh? Pndragon...? I'm pretty sure I just answered a question you asked. Did you somehow delete that question or are the bugs infecting to the forum!?
sascha
Site Admin
 
Posts: 2792
Joined: Thu May 20, 2004 9:16 am
Location: Austria

Postby dcuny » Sat Oct 22, 2005 12:07 am

Sascha wrote:Sorry about that - but as the title says - it's a development version.
Hey, no worries! The development stuff is just to give us a taste of what's coming along, even if it's not useful yet. I'm only trying to report things that actually look like bugs (instead of, you know, stuff that I shouldn't expect to work at all). Just give a little hint with the release as to what kind of feedback (if any) you want.

Don't let worries about it not being stable prevent you from posting the most current of your development releases. It's expected that it'll crash and burn. I'd much rather play with buggy software than look at pretty screenshots.
dcuny
 
Posts: 2902
Joined: Fri May 21, 2004 6:07 am

Postby pndragon » Sat Oct 22, 2005 1:17 am

Did you somehow delete that question or are the bugs infecting to the forum!?

Deleted it... I did not realize anyone had seen it yet. Sorry!

--- Jim
pndragon
 
Posts: 591
Joined: Sun Dec 05, 2004 1:27 am
Location: North Carolina


Return to Support / Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron