pouët.net

Go to bottom

Need some tips for 4k demomaking

category: general [glöplog]
Actually between opengl and dx9 what's the best for a 4k demo ???
I've read in some places that dx9 consume less byte for imports, function calls and so. I develop only with opengl and know it very well, but a change to directx to chop a few bytes in my 4k will not be a problem.

Also i want to include some pixel shaders effects, mostly for blur. I ve some ps script for ogl doing that but it's really huge (about 2k of text) and is not compiled, so not suitable for a 4k. Before I also try to render the scene into a texture and blur it by myself (cpu) but the result is really crappy/(or)slow.

I use gcc to compile my demo, will vc6/7 generate smaller files ?

Thanks
added on the 2006-08-20 00:26:31 by Tigrou Tigrou
Direct3D has less imports, because all you have to do is to initialize COM and get Direct3D interface. Also creating Direct3D device is said to be smaller than initializing OpenGL context. On the other hand, using Direct3D means lots of calls to virtual methods, which may take more space than simple OpenGL calls. Also Direct3D doesn't have embedded matrix math, like OpenGL does. Fortunately, sonce some time Direct3D extension (D3DX) is provided as a DLL, so you can use it and probably even import by ordinals, as D3DX DLL versions are well named (eg. d3dx_30.dll). Of course using yet another DLL may seem not too 4k'ish, but it's quite common practice now.

In Direct3D 9 you can compile vertex and pixel shaders to byte code using command-line tools, so this shouldn't cause too much problem.

I haven't tried gcc for 4k, but vc7 did quite well and vc8 express does just as good as vc7. vc8 express (Visual Studio 2005 Express) is a free product now, so all you need to code demos is Windows XP and decent download (with WinXP SP1 you need SP2, VC8E, PSDK and DX9SDK - each weighting tons of MBs).

Of course don't forget about Crinkler - compressing linker designed to make 4k (most 4k's use it nowadays).
added on the 2006-08-20 00:51:56 by KK KK
Quote:
I use gcc to compile my demo, will vc6/7 generate smaller files ?


now that is a serious problem. there are two possible answers:
1) yes
2) nasm

(google if you don't understand)
added on the 2006-08-20 21:09:03 by blala blala
LemonParty: how on earth do you manage to end up on about 2k of text for a blur-shader?
added on the 2006-08-20 21:12:38 by kusma kusma
also let me inform you, and everybody else, that a "4k demo" is in fact called a "4k intro" in the proper slang
added on the 2006-08-20 21:19:46 by blala blala
Check the IN4K wiki.
added on the 2006-08-20 21:26:14 by p01 p01
why call it 4k intro ? its usually not the intro for anything.



added on the 2006-08-20 21:47:45 by hollowman hollowman
I call 'em 4k's.
here's a tip for making dx shaders smaller for use in 4k: http://www.blackpawn.com/blog/?p=6

using d3dx in 4ks seems so wrong, but hey times change. the thing that stills bugs me about the d3dx use is it isn't already installed on your system. you have to go out and find or install the sdk or snag it from the install of another game, etc. using d3d or ogl at least it's on there with a fresh windows install.

anyways i've always gotten the impression that ogl is better for 4k.
added on the 2006-08-21 01:04:15 by blackpawn blackpawn
d3dx dlls are part of the d3d end-user runtimes available for download these days - i.e. you dont have to get it from the sdk or a game as you said - so that pretty much killed the whole d3dx in 4k debate. the only irritation is when the 4k is compiled using a very new version of the d3d sdk and the d3dx dll is newer than the one in the end-user runtimes, which is a good reason to keep an older version of the d3d sdk around. :)
added on the 2006-08-21 10:38:48 by smash smash
Quote:
why call it 4k intro ? its usually not the intro for anything.


for historical reasons. see also 64k _intro_.
(with the same argument, you could question the name "demo" for many productions as they don't demonstrate anything...)

anyway if you call it simply "4k" that's ok with me. just no "4k demo", please...
added on the 2006-08-21 12:45:46 by blala blala
blala: but if the 4k demonstrates something!
added on the 2006-08-21 12:53:21 by waffle waffle
smash: as far as i've seen, MS includes ALL d3dx_??.dll versions in the enduser redistributable (24..30 here), so older 4ks should continue working. hopefully.
added on the 2006-08-21 15:22:23 by kb_ kb_
kb: yea, old ones are fine, but the sdk is on _31 or later already - which means we have to wait around for the enduser to catch up.
added on the 2006-08-21 15:23:46 by smash smash
*cough* ok, now i've even understood what you've written. yeah. nevermind. :)
added on the 2006-08-21 15:25:26 by kb_ kb_
blala/waffle/truck/hollowman:
ze french people call it 4ko
just so you know.
Nobody has a some pretty small kick ass ps blur shader I can easily add to my 4k or a least some examples?

(I know how ps blurring works bust most of my implementations are really too crappy / huge)
added on the 2006-09-04 15:15:44 by Tigrou Tigrou
float4 pixel(VS_OUTPUT In) : COLOR
{
float4 color = 0;
float2 tex = In.tex;
for (int i = 0; i < 8; i++)
{
color += tex2D(blur_sampler, tex) * alpha[i];
tex += dir;
}
return color;
}
added on the 2006-09-04 15:45:50 by kusma kusma
it can proabebly be shrinked a more, i just pasted my normal blur-code because i find it simple and efficient enough.
added on the 2006-09-04 15:47:24 by kusma kusma
Thx for ur code, but like i said in the first post , my demo is in ogl and (I hope) will continue to be this way...

for ogl i had to use GLSL (right?). Most examples i found are done with plain text which is parsed at runtime...

it's not possible with ogl to lauch a utility that will parse my ps script, give me a binary i can include in my exe file after?
added on the 2006-09-04 20:07:50 by Tigrou Tigrou
until i create this topic I use ps this way
Code: !!ARBfp1.0 OUTPUT output = result.color; TEMP glow, turb, y, t, mid; PARAM glowFallOff = 0.2; PARAM color = { 1.70, 1.48, 1.78, 0 }; TEX turb, fragment.texcoord[0], texture[0], 3D; MAD turb.x, turb.x, 2, -1; MAD_SAT t.x, fragment.texcoord[1].y, -fragment.texcoord[1].y, 0.15; MAD y, turb.x, -t.x, fragment.texcoord[1].x; ABS y, y; POW glow.x, y.x, glowFallOff.x; MAD glow, -glow.x, color, color; MUL glow, glow, glow; MUL output, glow, glow; END

after i use GL_FRAGMENT_PROGRAM_ARB to load it
added on the 2006-09-04 20:10:50 by Tigrou Tigrou
ok ok, here's a dollar, now shoo!
wt?
I just wanna some help...
Is pouet BBS only for €l|te H@xor +10 years certified farbrausch programmers???

The example i posted was only there to show how I do until right now coz i dont know any other way to do it in ogl
added on the 2006-09-04 21:50:02 by Tigrou Tigrou
no, pouet BBS is also for David Hasselhoff's fan club.
added on the 2006-09-04 21:58:28 by p01 p01
Don't you think pixel shaders / fragment programs would be a little overkill for a 4k intro? 4096 isn't that much after all... If all you need is some blur, there are some cheaper ways to do that.
added on the 2006-09-05 00:19:11 by kanttu kanttu

login

Go to top