Recent

Author Topic: I've made some fairly significant progress on JuhaManninen's port of DeleD...  (Read 33101 times)

Akira1364

  • Hero Member
  • *****
  • Posts: 539
Status update time:

The longer I work on DeleD, the more I realize just how much the application as a whole was held back by the fact that the original developers were actively concerned about maintaining backwards compatibility with hopelessly outdated hardware and ancient Delphi versions like Delphi 5/6/7. Well, maybe Delphi 7 I could have vaguely understood in 2011 (the last year the Delphi version was worked on, before JuhaManninen started the Lazarus port in 2013), but 5 and 6? Give it up already! To be more specific, what I mean is that after getting the application to a relatively "stable" point (as in stable including the major project-wide changes I've made) a couple of weeks ago, I started going through unit-by-unit specifically looking for areas where I could further "trim the fat", as I obviously don't share the original developers compatibility concerns (or any compatibility concerns when it comes to Delphi for that matter, as it would be literally impossible now). There were/are so many. To provide (just one) example, there was an 800-line (now unused) unit called "unit_TextureManipulator" that did absolutely nothing other than to (somewhat poorly) implement a total of four unique image-editing functions (drawing a line on an image, blitting text to an image, adjusting the alpha channel of an image, and finally, performing a flood-fill on an image.) Woo-hoo! Not. Every instance of its use in the application has been replaced with a call to the relevant BGRABitmap function/procedure, which reduces each of those instances from about 20 to 40 lines to 1 or 2. (As there is no longer a need to create a unique TTextureManipulator instance, pass the texture data to it, and so on, because all images are now themselves BGRABitmaps to begin with!) From there, the rabbit hole just gets deeper... I mean, here is a literal, direct copy-and-paste of a comment that was left in the code of a function called Tfrmside.UpdateProjection (which as the name suggests, updates the OpenGL projection of the 2D "side" viewport):

Code: Pascal  [Select]
  1. // INFO, PJ: On my Win98 Laptop, UpdateProjection is called before camera is initialized.

Cool, man! That matters a lot, currently, and I will be sure to keep it in mind.  ::)

Even in the somewhat unlikely case that "PJ" wrote that comment in 2004 (which is the year development on DeleD first began, as near as I can tell), it still would have been a borderline irrelevant issue referring to an outdated operating system running on the most niche hardware possible. (How many people who weren't lawyers or "businesspeople" that got issued them them by their employers really bought Windows 98 laptops for home use? And to those who did...Why? I personally found it extremely obvious (back then) that buying a laptop meant a drastic loss in performance for a non-trivially higher amount of money).

Not to fret, though: I'm no fan of vaporware personally, so although I've mostly stopped caring about trying to "release" the updated codebase by a specific date (my real-life job has enough deadlines to begin with! :P) I will say that you can all 100% for real expect to see a full-project upload by the end of the summer (meaning late August or so).

Also, just to be clear, none of this was meant to suggest that the original developers were individually "bad" at what they did. Obviously, that isn't true, or DeleD would never have reached the point it did. More so this was just kind of a tongue-in-cheek venting on my dislike of the combined "too-many-cooks-in-the-kitchen"/general red-tape syndrome that too often creeps into collaborative projects.

circular

  • Hero Member
  • *****
  • Posts: 3053
    • Personal webpage
Wow lot's of things to do on Deled.

Happy my lib is useful  :)
Conscience is the debugger of the mind

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7627
Even in the somewhat unlikely case that "PJ" wrote that comment in 2004 (which is the year development on DeleD first began, as near as I can tell), it still would have been a borderline irrelevant issue referring to an outdated operating system running on the most niche hardware possible. (How many people who weren't lawyers or "businesspeople" that got issued them them by their employers really bought Windows 98 laptops for home use?

Simple business sense.  XP is from late 2001, but laptops with it preinstalled only came later (well in 2002). So I wouldn't be surprise that say by early 2004, a significant enough share of the customers still ran '98. You don't buy a laptop every two years.  (and you could rarely put enough memory in them to upgrade them manually)

That said, best wait a bit, and raise the limit directly to FPC 3.0.2+, with advanced TRectF and TPointF for vertices.
« Last Edit: July 31, 2016, 10:59:49 pm by marcov »

Akira1364

  • Hero Member
  • *****
  • Posts: 539
Even in the somewhat unlikely case that "PJ" wrote that comment in 2004 (which is the year development on DeleD first began, as near as I can tell), it still would have been a borderline irrelevant issue referring to an outdated operating system running on the most niche hardware possible. (How many people who weren't lawyers or "businesspeople" that got issued them them by their employers really bought Windows 98 laptops for home use?

Simple business sense.  XP is from late 2001, but laptops with it preinstalled only came later (well in 2002). So I wouldn't be surprise that say by early 2004, a significant enough share of the customers still ran '98. You don't buy a laptop every two years.  (and you could rarely put enough memory in them to upgrade them manually)

That said, best wait a bit, and raise the limit directly to FPC 3.0.2+, with advanced TRectF and TPointF for vertices.

If you're referring to companies when you say "the customers", then if you re-read what I said you'll see I was talking about individual people who did not specifically require a laptop for work, and who were not issued them by their employers, but just simply went out and bought them to use at home for no particular reason. The overall point was that the laptops of that era were in general simultaneously very expensive and very terrible, compared to the still quite expensive but somewhat less terrible desktops, so buying a laptop was not a particularly financially sound decision unless you really needed it. Or, more specifically, the point was that being concerned about whether or not the 3D modelling software you're writing would run properly on Windows 9x laptops would have already been veering into the realm of "over-cautious" in 2004. Which is, again, the absolute earliest that comment could have been written.

As far as your second point, I feel as though I detect a hint of sarcasm? :P I suppose it would depend on how well fgl.pp worked in 2.6.4 and lower, as the application now uses TFPGObjectList descendants pretty much exclusively when it comes to containers.

EDIT: To be clear, I use trunk everything, all the time. Yes, yes, everyone always says "Rarrgh, trunk Lazarus is NOT meant to be used with trunk FPC! >:D" but I have historically found the combination of trunk Lazarus/trunk FPC to be pretty much always objectively better than the latest "official combined release" of FPC and Lazarus. I suppose this serves as a testament to the overall abilities of the FPC/Lazarus development teams: they very, very rarely introduce bugs that break compatibility between the two.
« Last Edit: August 01, 2016, 01:07:20 am by Akira1364 »

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7627
As far as your second point, I feel as though I detect a hint of sarcasm? :P

No. A bit tongue in cheek maybe since it suggest using a not yet released version. But I actually implemented it because of OpenGL work.

I also agree with you that the lower versionitis is actually a point in FPC/Lazarus favor. 95% of the users are on the last 2-3 releases.

Quote
EDIT: To be clear, I use trunk everything, all the time. Yes, yes, everyone always says "Rarrgh, trunk Lazarus is NOT meant to be used with trunk FPC! >:D" but I have historically found the combination of trunk Lazarus/trunk FPC to be pretty much always objectively better than the latest "official combined release" of FPC and Lazarus. I suppose this serves as a testament to the overall abilities of the FPC/Lazarus development teams: they very, very rarely introduce bugs that break compatibility between the two.

Thank you, me too, but I suggest holding off updating for a while. My trunk/trunk was broken totally yesterday.

Akira1364

  • Hero Member
  • *****
  • Posts: 539
As far as your second point, I feel as though I detect a hint of sarcasm? :P

No. A bit tongue in cheek maybe since it suggest using a not yet released version. But I actually implemented it because of OpenGL work.

I also agree with you that the lower versionitis is actually a point in FPC/Lazarus favor. 95% of the users are on the last 2-3 releases.

Ah, my mistake then.

Akira1364

  • Hero Member
  • *****
  • Posts: 539
More choice cuts from DeleD (this was in the code of "frmMaterialEditorForm":

Code: Pascal  [Select]
  1. type
  2.   THackSplitter = class(TSplitter)
  3.   end;

Which was later used like this:

Code: Pascal  [Select]
  1. THackSplitter(splVertical).OnDblClick := splVerticalDblClick;

Because, you know, if we don't have the ability to assign double-click events to TSplitters, do we really have anything at all?

The actual "splVerticalDblClick", if you're wondering, was an entirely unnecessary procedure that did some resizing of a panel based on the current position of a neighbouring groupbox, for no obvious reason. It had nothing to do with the Splitter!

Akira1364

  • Hero Member
  • *****
  • Posts: 539
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #37 on: September 04, 2016, 03:44:30 am »
Checking in:

I'm aiming to upload the full codebase for the application sometime Monday evening, as I have a day off work for "Labor Day"... if you're not from the United States (or Canada like me) and you don't know what that is, don't worry, it's not particularly important. :P

Significant changes since the last time I posted:

-The application no longer uses an "Application.OnIdle" notification to handle the redrawing of its viewports, or for anything else. Previously, all open viewports were redrawn endlessly as fast as the CPU could do it, regardless of whether or not they needed to be, which was a non-trivial yet entirely avoidable drain on performance. Now, they're only redrawn based on specific input from various user actions.

-The raytracing engine and main raytracing form have been completely revamped. Specifically, the raytracer itself now renders directly into a TBGRABitmap (instead of a disposable "TTextureData" record) which is much "safer" in the event of a crash (since the bitmap can be loaded "from file" and properly picked up from where it left off), and also seems to be noticeably faster, for me at least... As far as the raytracing form, the real-time preview is now displayed in a TBGRAVirtualScreen (instead of a TDrawGrid cell) and can actually be turned on and off arbitrarily (whereas before you were stuck with the pointless "thumbnail" preview no matter what, which I'm sure for users running lower-end systems would have been incredibly annoying.) Additionally, all items in the raytracing "queue" (completed or not) are now listed in and can be selected/displayed from a TComboBox in the form.

-Quite a few other things that I'm too tired to get into right now.

Here's a screenshot of me working on the Castle Siege example scene while simultaneously doing a raytrace of the Sanssouci example scene:
http://i.imgur.com/MmCWpAI.png
« Last Edit: September 11, 2016, 03:09:33 am by Akira1364 »

circular

  • Hero Member
  • *****
  • Posts: 3053
    • Personal webpage
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #38 on: September 05, 2016, 11:49:16 am »
Oh nice raytracing.

I am not sure if it matters, but SetPixel is slightly slower than using a PBGRAPixel pointer for one scaline. However compared to the raytracing anyway, that may not be significant.

I guess there is also the number of refresh of the raytracing screen per second. For example if you redraw the previous for each pixel, that would obviously be slow.

You can also consider calling InvalidateRect to redraw only the portion of the TBGRAVirtualScreen that has some change. I wonder if it would be handy to have such partial redraw function in the TBGRAVirtualScreen class.
Conscience is the debugger of the mind

Granada

  • New member
  • *
  • Posts: 7
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #39 on: September 14, 2016, 02:22:24 pm »
Hi Akira1364

I am one of the original testers of DeLeD and wonder if there is a compiled x version i can try out (i still use DeLeD daily ).

Many thanks Dave 

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3655
  • I like bugs.
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #40 on: September 14, 2016, 03:18:31 pm »
I am one of the original testers of DeLeD and wonder if there is a compiled x version i can try out

No there isn't any version from Akira yet. I also wish he would publish it ASAP.
An open source motto is "release early, release often". The SW does not need to be "finished" or "ready" before it is published.
I honestly don't understand why he is holding it back. :(
« Last Edit: September 14, 2016, 03:21:24 pm by JuhaManninen »

Granada

  • New member
  • *
  • Posts: 7
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #41 on: September 14, 2016, 03:40:40 pm »
Quote
No there isn't any version from Akira yet. I also wish he would publish it ASAP.
An open source motto is "release early, release often". The SW does not need to be "finished" or "ready" before it is published.
I honestly don't understand why he is holding it back. :(


Thanks for the info,i will just have to wait  :).

Dave

Granada

  • New member
  • *
  • Posts: 7
Re: I've made some fairly significant progress on JuhaManninen's port of DeleD...
« Reply #42 on: September 24, 2016, 01:01:28 am »
Quote
I honestly don't understand why he is holding it back.
He must be busy ,Shame i was looking forward to trying this  :).

Dave

Granada

  • New member
  • *
  • Posts: 7
Looks like this might be Dead now ,Sent a pm a while back with no reply.Shame i was looking forward to this  :(.

Dave

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3655
  • I like bugs.
Looks like this might be Dead now ,Sent a pm a while back with no reply.Shame i was looking forward to this  :(.
Yet he felt important to report his "progress" in lengthy posts, like "Significant changes since the last time I posted:" and such...
Why? That is quite weird when nobody was allowed to see his "significant changes".
My diagnosis: It is a hoax! He did not do the things he claimed he had done.