Nice to see you again, Mike ;) *bows back*mrToad wrote:paul doe - I have returned. *bows to you*
...
Still doing boring stuff for a living, but working on different projects of my own. And yes, it's pretty much similar to any freelance activity =DmrToad wrote: ...
;D How are you?
It's a shame on me to be gone so long from this forum. I've returned to find good things, though.
Have you been working on anything fun or still doing the "boring financial stuff"? Did you meet your goal of becoming an independent trader? (I'm guessing that's like a freelance coder?)
...
Indeed I did. I've implemented a 'proper' blitter using FBOs and shaders, with all the blending modes we've discussed here (and others). Works like a charm. It's part of another, bigger GL framework but I can easily pluck it out if you want it to use as-is. Don't expect it to be as straightforward as this version is, though. You see, GPUs are really fast if you do process in bulks. Otherwise they become remarkably slow. This basically means that: *1* Your data needs to be carefully arranged in memory for them to upload/download it faster and *2*, you'll likely need to refactor a lot of your code to use it.mrToad wrote: ...
I re-read our conversations recently and reviewed all the code you wrote, taking my time with it. Although I'm no true GL programmer, I understand it a lot better due to your good commenting. Did you ever make further progress with the blitter?
...
That happens because, when you scale down, you invariably have to interpolate the pixels, leading to information loss (that's why the scaled image looks bad). There's no way around it: scaling a bitmap involves either loss of information (scaling down) or adding information that isn't there in the first place (scaling up). Generally speaking, nearest-neighbor interpolation leads to poor results when scaling down, so you need bilinear (at the very least). Also, if the pixels need to be rotated, you'll need to use sub-pixel accuracy to do it, otherwise you'll end up with 'gaps' between the pixels (due to rounding). All this, as you can imagine, consume a lot of resources and is, thus, quite slow in software. Factor in the blending modes and you'll find that, while you can certainly blit a few pixels with a reasonable framerate, real-time would be almost impossible.mrToad wrote: ...
Although I've been working on other parts of the game, I recently attempted to change rendering to just software, incorporating your FB blending blitter, and Joshy's PutResize code for scaling the final render to user resolution. It's actually quite fast on my 10-year-old laptop! (I haven't tried it on any genuine 'craptops' yet.) The issue is now that I cannot scale down any graphics, or I will lose pixels. It doesn't look terrible in all cases but sometimes it's pretty rough. Also the GUI and fonts currently require being scaled to fit more text and save room on the screen.
...
If you're doing the kind of scaling you show in the image, then you may want to do trilinear interpolation (along three axes; the third axis being, of course, the available images to interpolate from).
There's really no need. I'll upload a better version once I refactor it to deal only with 2D blitting ;)mrToad wrote:...
So here I am wondering if I could beg, bargain, or threaten you to finish up that GL blitter? ;) ...
Framebuffer Objects (FBOs) are pretty straightforward to use, actually (check the OpenGL docs). Another option is Render Buffer Objects (RBOs) and/or Pixel Buffer Objects (PBOs) but not all cards support them (if I recall correctly, being able to run it on an abacus was part of the requirements XD)mrToad wrote: ...
You left off with a nice Add shader, and basics of scaling/rotation/opacity. I could use merely a Flip option and an Overlay shader, both of which I might be able to code myself. The real problem is how you didn't render via Framebuffer Objects, but did a sort of "hackish" render. It's still beyond me how to do it properly. If you haven't the time, no worries. I'm just checking out my options for final rendering.
...
Yes, all is as it needs to be =DmrToad wrote:...
In any case, hope all is well. I've got more things to talk about but probably for another thread. :)
Well, I was wondering how were you faring (been playing FF Mystic Quest for SNES a lot lately =D) so I guess that pretty much answers it. So, as soon as I have a little time, I'll upload an update for the blitter.
PS: if anyone else has tried something in this respect, please, share your thoughts and insights with us! Yeah I'm looking at you angros47 and Joshi ;)