Page 1 of 2

OMG... I finally did it!

PostPosted: Sun Apr 08, 2018 11:51 pm
by Taron
I'm sorry guys, but I'm so exhausted from total joy, I'm almost in a kind of shock. I have finally, finally, FINALLY ( :tantrum: ) F I N A L L Y managed to write 16 bit import for pngs. It's likely super limited in terms of png formats, I don't know, haven't tested everything, yet, BUT IT WORKS! It freaking works. :cry:
IT WORKS! :bounce:

Yes, I'm sure many if not all of you might be wondering: "what on earth is wrong with Taron?!"
See, now, I'm writing Verve in BlitzMax, which is by now literally a dead language. It's like writing code in Latin, except, uhm, probably a bit easier. BlitzMax was meant for small stuff, like little games and such, totally aiming at no more than 8 bit graphics. Therefore there has never been any support for 16 bits per channel graphics. I- for some reason- had managed to write a 16 bit png saver, which I only remember as a kind of trance state in which I somehow bit myself through everything I could find out and wrestled the code into place. But for the loading I could NEVER find anything to really get me there. It drove me bonkers for years. Eventually I gave up and thought, hey, I will switch to C++, use some standard libraries and that's that. But- for another curiously unknown reason- today I thought, I will have another look at it. Years went by and I might've learned things and gained enough confidence to examine it all again. And when I started with it today, I felt like nothing had changed. I ran into the same problems I had before, saw all the same roadblocks. But then, suddenly, something in my mind sort of clicked. Standard memory copying could never work and with this revelation I sort of went: :shock: ... :o ... :PP ... ME SO STUPID! SO STUPID! I had to gather the bytes into dwords and then floats and then divide them by $ffff and VOILA! OMG... :ud: ... :geek: ... :ugeek: ... :hyper:
:bounce:

So, yeah, now I will write all import functions I've always wanted, including choosing a channel (color or alpha) for material amount on the canvas and so on!
If everything goes as I expect it, you can do some incredible stuff with this... like... really fun stuff! :hyper:

Should probably put that into my def diary and then...eh... delete it immediately so nobody will ever find out about my shame! :hihi: :oops:

HHAAAAAA!
Yes, yes, I'm happy, I really am. :D

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 7:43 am
by Pilou
Congratulations! :beer:

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 9:19 am
by Knacki
:rock: :rock: :rock: :rock: :rock: :rock: :rock: :beer:

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 10:44 am
by Taron
THANKS!
A small reminder: It's "ONLY" 16 bit and Verve is not a 3d painter, but...

This is a quick sculptris doodle from a while ago. I saved a depth image, imported into Verve and had some quick fun with it... this is realtime, of course, and pure Verve lighting with some paint on it:

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 5:13 pm
by Taron
Ha...well, guess I got it now! :hihi:

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 5:55 pm
by Pilou
Lovecraft creature! Always a quietful style! :mrgreen:

Re: OMG... I finally did it!

PostPosted: Mon Apr 09, 2018 10:17 pm
by Knacki
Holy :shock: I start to get an idea..

Re: OMG... I finally did it!

PostPosted: Tue Apr 10, 2018 12:26 am
by Taron
Now that I can import 16 bit, a whole new world of possibilities has opened up, that is for sure! Including my reevaluating fluids... it is rather exciting! 8-)

Re: OMG... I finally did it!

PostPosted: Tue Apr 10, 2018 8:14 am
by Zeropainter
great - congratulations also from me :beer:

Re: OMG... I finally did it!

PostPosted: Tue Apr 10, 2018 12:42 pm
by Taron
Thanks, Zero!
Now that I get calm on the matter, I've realized that I could just make a dword buffer, sparing one more transform, but I have to make in openGL a 32F buffer, for some reason, so that it works properly with the material buffer. And it works beautifully! I'm still just as thrilled and am starting to make an interface for the import with a variety of choices. I'm also thinking about import/export of normal maps, but we shall see. The import options likely will be:
- (checkbox) LOAD COLOR
- (checkbox) LOAD MATERIAL (choice: from R, G, B, A, Luminosity and maybe Saturation. Hue would require more options, which is why I will skip it for now.)
- maybe I will add LOAD NORMAL MAP

If LOAD MATERIAL is unchecked, the material on the canvas will be set to 1.0.
If you have any more suggestion, don't hold back!