Friday, June 18, 2010, 05:26 PM
Posted by Administrator
choo choo! Get on board the rant blog :)Posted by Administrator
"So we grab the screen, blend that with the screen effect, and chuck that back up on screen. Simple!"
Translated:
"So we resolve the rendertarget (16bpp @ 1280x720x2XMSAA ~= 1.8ms), create a material effect that consists of a custom photoshop style overlay blending of the screen with some gore effects dripping down the screen and writing that back over the rendertarget paying 100% fill cost (1.9ms). Slow! (~3.7ms for a simple gore-on-lens effect)"
With most engines (proprietry or otherwise) now giving easy access to arbitrary buffer useage and art controlled malleable render pipelines, I'd like to make a taboo suggestion or two.
Maybe "last-gen" techniques and methods shouldn't be restricted to the last generation of hardware, and ignored when creating this generations games.
Maybe we should try and use the free 15 year old hardware functions before we re-invent it on a per pixel basis.
The above is a real example from a few years back, and here was the solution:
- Don't resolve (free ;) )
- Use a stencil, or draw an object over the screen which has been cut into the shape that the material can touch (minimise fill)
- Write material effect and change the blend mode to 2x multiplicative blending (visually identical to the custom blend. Most common photoshop blend modes can be emulated with hardware blendmodes)
= ~0.6ms
The original used dynamic branching conditionals to do the overlay blend effect, so that anything above 0.5 would multiplicatively brighten, and anything below would darken (leaving 0.5 doing nothing).
The equivelant is changing the hardware blendmode to the classic 2x multiply:
dest = (sourceRGB*destRGB) + (destRGB*sourceRGB);
which can be broken down to:
dest *= 2*sourceRGB;

Archives



