-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize Token VBL Generation #1218
Comments
Need to test with the other simplify methods. Update: The other simplify methods are also unable to handle shapes with holes in them. |
I think I one of the methods had a second option that may need to be explored. I assume we want holes for things like caverns and such. I'm liking the reduction in points though! |
Need to look at the options and see if they can help. |
Lots of options added to the VBL panel 😨 Color picking isn't enabled yet but I see that replacing "Sensitivity" (the old Alpha Sensitivity" and let you pick a RGBA instead. So you could pick "black" vs just alpha. Added an Inverse button so you can generate VBL around an object vs over now, good for maps! FWIW the Image -> Area is the longest (10+ seconds for maps) but the Optimization is in milliseconds usually so I started to cache the Image -> Area work and it's only redone if you change sensitivity or click the generate button. There is still some bugs on opening up the dialog and keeping state for that so, ya. More to do... |
Oh, and I added point counts to the preview for debugging but thinking of leaving it in permanently, or at least the optimized number) AND also added zooming/panning to the preview window! Gotta see those pixels! Here are some maps I used for testing. It Seems to handle holes ok in all JTS optimizations... |
…tion Feature token vbl simplification #1218
Now using .setEnsureValid(false) and not forcing valid "geometry" any more seems to fix the issue. May need to test a few more odd shapes here and there... |
Optimized the image translation to Area, by slicing the image up I got over 32x performance increase on this map! *Note I was going to multi-thread it into slices but even before that, just by slicing the image into 100x100 chunks, the Area.add math is a lot less intensive, The following image use to take 32 seconds and now averages < 1 second. I may still throw this into a thread pool and see if we can do this in 100-200 ms instead for even better UX (right now this is still on the UI thread...) |
OK, I believe I'm all done with this issue, barring any bugs/suggestions. Here is a macro for fun and documented usage:
|
Tested and working as expected. Closing. |
- Fix VBL color cursor not longing changing to the crosshair cursor after being used once - Issue discussed in RPTools#1218
There is a small bug in a token editor: after the VBL color has been picked once, the cursor no longer changes to the crosshair cursor. PR #1544 fixes this. |
- Fix VBL color cursor not longing changing to the crosshair cursor after being used once - Issue discussed in RPTools#1218
Is your feature request related to a problem? Please describe.
Token VBL generation produces very complex VBL structures leading to poor performance. Especially when used on map images.
Describe the solution you'd like
Use the polygon simplification of the JTS libs to reduce the number of points and edges produced by the VBL generation.
TODO:
Additional context
JTS Lib Simplify
Campaign file with two maps and closed/open object images.
VBL Simplified Test-cmpgn.zip
The text was updated successfully, but these errors were encountered: