pouët.net

How much is too much?

category: general [glöplog]
 
BB Image

So I don't have a very high-end graphics card. I really can't do shader model 3 in hardware so I don't have a sense for what is too much. My mate is deathly afraid of switching multiple pixel shaders per frame and I am wondering if this has any meaning. Doing multiple passes into and from textures is probably a little intense on the memory bandwidth but I imagine most of this stays inside the card. Is there a bottleneck with loading and unloading shader programs? With my pixel shader 2 card I can switch pixel shaders every other frame at 60 fps. Does anyone use multi-shader-per-frame in practice? if so, about how much is too much would you say?
added on the 2010-03-05 04:28:35 by sigflup sigflup
oh great. now the link turned into an ad. That was someone passed-out
added on the 2010-03-05 04:36:55 by sigflup sigflup
sigflup: In Muon Baryon's final version we used about 15 GPU programs whose sources are procedurally generated as well. The transitions however are quite transparent. And, in our upcoming prod I often change GPU programs and FBOs within the same frame for shadow mapping etcl. without any visible performance hit on a GeForce 9400M.

Well, I think creating a mayhem out of state changes etc is not a good idea but I don't think a few switches here and there would affect your rendering considerably.

Sorry it's 5:40 AM here and I have been up working on something so I might sound a little wacky. :)
added on the 2010-03-05 04:38:55 by decipher decipher
Good morning decipher! Huh, you generate the shader source in muon baryon? That's pretty neat- I imagine you are moving around the marching geometry mainly and other parameter-ish things. May I ask what other trickery is in that prod, it's really really nice?

So I'm not clear as to if 15 is the total number of shaders or you are mentioning that there are 15 gpu programs going on in one frame. Could you perhaps clarify a litttle?
added on the 2010-03-05 05:02:38 by sigflup sigflup
Morning sigflup :). no the GPU programs are not run concurrently however the drivers usually "compile" from byte code to opcodes on demand depending on the current state which causes a very visible throttle in the flow (which is why there is a dummy glUseProgram in the generator loop). I think I got your original question a bit wrong :). However in this other project I am working on I switch between 3 programs in one frame with the geometry being rendered 2 times and you can't even feel it (again 9400M).

as for the other tricks, the sources are in the package :D. there isn't much going on other than the procedural cut & stitch and using the same address for data storage (which in theory creates repetitive opcodes).

anyway I am about to faint so off to bed I go :D
added on the 2010-03-05 06:08:02 by decipher decipher
ahh there is source code. Neat. Good night mate.
added on the 2010-03-05 06:22:27 by sigflup sigflup
... I wonder, are there any tools to determine how the gpu's memory is being utilized?
added on the 2010-03-05 08:47:03 by sigflup sigflup
you can easily change shaders hundreds of times per frame without causing any real performance problem. virtually everything we've released since 2004 does this. (>150 unique shaders is fairly common, although most of them are variants of the same basic shader).

creating the shaders and (depending on the driver) using them for the first time is expensive, but switching them during the frame isn't that bad - about 2x as much work as changing the active texture on the cpu side, and some pipeline bubbles on the gpu side.
added on the 2010-03-05 09:06:52 by ryg ryg
Acknowledged, the engine behind dimness' three fourth heavily depends on switching vp/fp shaders while rendering a single frame, and the process apparently doesn't have a noticable impact on the performance (tested on 9600gt and mobile 8400m gs)
added on the 2010-03-05 13:39:33 by kbi kbi
OT: There's no ad here. maybe because I disabled referrers in my browser and FunnyChill.com has some referrer blocking? :-)
added on the 2010-03-05 18:39:28 by mihi mihi
If I start bumping into things, it's too much.
added on the 2010-03-05 23:27:11 by trc_wm trc_wm

login