pouët.net

Go to bottom

win32 1k compression for dummies

category: general [glöplog]
hitchhikr: please test this one:
http://www.rbraz.com/temp/1k_framework.zip

You can include it into your package, if you like.

Quote:
; I think even a minimal vertex shader is required on NVIDIA cards
; but i'm not totally sure.

Works fine on my Geforce 6600GT, I will test it on the 8800 tonight..


added on the 2009-03-09 16:36:31 by rbz rbz
1kpack 0.5 give me 1 byte less than 0.3 (and 3 bytes less than 0.4) but crashed (xp sp2)
added on the 2009-03-09 18:12:46 by Tigrou Tigrou
ftp://ftp.untergrund.net/users/hitchhikr/1kpack_v0.6.zip

If it still crashes you may send me your file (unpacked) so i can check it
(name: hitchhikr server: australia.edu).
added on the 2009-03-09 18:22:58 by hitchhikr hitchhikr
Some animation support, using GetConstantByName/SetFloat. It assembles into 662 bytes (based on v0.5).

For whatever reason it only works on my laptop if I insert some shader code that actually does something. The minimal shader that only returns the same color for every pixel crashes the application (Vista/GF7700).
added on the 2009-03-09 22:58:27 by mic mic
v0.6 is smaller.

It doesn't work because the compiler optimizes the shader where the constant isn't used so it discards it and GetConstantByName returns 0,

Nothing to do with the packer which afaik works correctly, tigrou made a mistake by using an older depacker.bin which isn't compatible with the newer version as i used it's 2 last x86 instructions to mimic the zlib stream starting flags (so the stream starts inside the depacker).

Also, you don't need to use the uniform keyword and there's a much smaller way to pass constants data to a shader, if you want to work with hlsl i suggest you to get your hands on render monkey or any equivalent tool asap.
added on the 2009-03-09 23:23:06 by hitchhikr hitchhikr
i'm dead late on the thread. just this: hitch, congrats for the brilliant idea :)
added on the 2009-03-10 04:40:32 by makc makc
Quote:
if you want to work with hlsl i suggest you to get your hands on render monkey or any equivalent tool asap.

Yeah, I might do that eventually. In the meantime, I went ahead and used SetPixelShaderConstantF to do animation in v0.6. It's 628 bytes.
added on the 2009-03-10 07:08:16 by mic mic
..of course, the slightly smaller version would be

push dword 1
lea ebx,[ebp + Delta]
fstp dword [ebx]
push ebx
push dword 0

At first I thought it wasn't working, but I'd probably just screwed up the alignment.
added on the 2009-03-10 13:21:38 by mic mic
Hi guys, cool idea!

Great to see some useful stuff going on here for a change.
added on the 2009-03-10 14:17:33 by trc_wm trc_wm
Yeah, it's a great packer to have, so kudos to hitchhikr. My latest sine-distortion bonanza currently compresses to 1001 bytes: http://jiggawatt.org/picsplz/monjori.jpg
added on the 2009-03-10 14:38:33 by mic mic
looks great! please release that so I can thumb it up!
added on the 2009-03-10 14:52:27 by stijn stijn
I've still got some bytes to spare, so I'll see what I can do with them first.
added on the 2009-03-10 15:17:10 by mic mic
Just comment: that trick's quite cool and it works fine. And I've recognized pretty late its like syntax from "metalwork". I modded that one smaller when it came out, atleast added filtering and some kind of colorramp.

But this is alot better ;D
added on the 2009-03-11 01:12:41 by yumeji yumeji
ftp://ftp.untergrund.net/users/hitchhikr/1kpack_v0.7.zip
ftp://ftp.untergrund.net/users/hitchhikr/test_v0.7.zip

I won 8 bytes in the depacker but i don't know if it's safe (should work fine under XP).
added on the 2009-03-11 19:52:32 by hitchhikr hitchhikr
Test ok on Vista 32-bit.
added on the 2009-03-11 20:03:33 by mic mic
hitchhikr > would there be a way to have the pixel shader in its own file for easier edits?
That's actually quite easy, just create a shader file and replace it within the framework.asm with this:

Code: PShader: incbin "nameofthefile" fPShader:


Be careful tho because the binary may contains end of lines chars which will increase the size of the packed executable.
added on the 2009-03-11 20:42:40 by hitchhikr hitchhikr
Is 1k pack dead? None of the binaries work on my win7.
added on the 2011-02-13 00:06:51 by las las
Well... If it doesn't work for you then... yeah maybe it's deadly incompatible with 7.

But... why you asking?... You were about to code a another raymarching 1k? ^^
added on the 2011-02-13 00:32:11 by yumeji yumeji
exactly. :)
added on the 2011-02-13 01:18:25 by las las
just for the scene spirit:

@las pack all the fx into 4k and part it with a good synth, rather than sticking to a "win"."dead" size limitation that's mostly only good for mute graphics!!!... the "crowd" will love you for some sound. ;)
added on the 2011-02-13 01:45:26 by yumeji yumeji
i don't care about the crowd for tech-demos - because the crowd keeps the fuck you anyways :D
added on the 2011-02-13 12:19:35 by las las
las: 1kb fractal zoomer with source might be worth looking into if you need a 1kb framework
added on the 2011-02-15 00:07:34 by Xetick Xetick

login

Go to top