Curious on converting pixel shaders to background
I don't know that much about HLSL, or the implementation of it in HWA/MMF, just enough for me to have penned a few of my own shaders for use in my projects. But I'm curious on a concept, if anyone knows more about it.
I recently altered a pixel shader of mine to allow it to operate as a background filter, ignoring the image of the object and just applying it like as a lens over the background (much like Looki's lens effect). This got me to thinking. Is there some way MMF could offer an option to use a pixel shader as a background filter?. AFAIK, any pixel shader effect that operates entirely on an image, without the background, could be 'piped' to use the background texture instead. And I imagine theres some way that this could be added as a feature for pixel shaders that don't access the background already.
For example, if there was a checkbox that would allow the "Monochrome" pixel shader to operate on the background- the area covered by the active object's X & Y bounds would be rendered monochrome, and the object 'invisible'.
It seems like it could be a useful feature, but I've got no idea on if its feasible
6 Attachment(s)
Re: Curious on converting pixel shaders to background
Err, actually, for those interested, I've got these three shaders I'm happy to post up for anyone to use. If they're worth adding into the 'finished shaders' forum that would be dandy. Just neat effects people might want to use:
#1: PT_Rotate
This is a simple 'optimized' edited versions of Sphax's rotation pixel shader. It uses a sin/cos pseudo matrix instead of polar coordinates, which makes it run much faster- I use it on a 512x512 image at 50 FPS as a core part of one of my games, and the original rotate shader was not efficient enough.
#2: Squeeze
This creates a 'black hole' effect, pulling all pixels in towards the center of the object, as pictured below. Optionally can have a little rotation around the center as it pulls inwards.
http://img101.imageshack.us/img101/7314/squeeze2.jpg
#3: Squeeze Filter
This is the same as the above, except works as a filter on the background instead of on an object- an object using this will use its X/Y bounds to create an ellipsoidal (circle) transformation of the background. You can overlay your black hole on top of the screen, as pictured:
http://img693.imageshack.us/img693/9249/squeeze1.jpg
Re: Curious on converting pixel shaders to background
Can you upload some MFAs to showcase them?
They are looking great. You, sir, are turning into a HWA wiz.
2 Attachment(s)
Re: Curious on converting pixel shaders to background
Oh yeah, good idea.
Here you go:
(uses looki's lens effect, too)
Re: Curious on converting pixel shaders to background
Seems there's something wrong with the archive - "LensTest.zip: The archive is either in unknown format or damaged"?
Re: Curious on converting pixel shaders to background
Worked fine for me.
And it looks just like a black hole. Nice job Pixelthief!
Re: Curious on converting pixel shaders to background
Right, now it works (weird, before it gave me a corrupted archive two times in a row). Anyway, I get this:
http://i44.tinypic.com/ftogg7.jpg
Is this how it's supposed to look? I guess I'm doing something wrong - sorry I'm new to HWA.
Re: Curious on converting pixel shaders to background
Has it opened that in normal MMF, rather than HWA version?
Re: Curious on converting pixel shaders to background
HWA
Edit: TGF2 that is, not MMF2
Re: Curious on converting pixel shaders to background
Same difference I think - just make sure you've got the Lens shader installed as well as the 3 shaders in the top post here.
They go in the c:\Program Files\Games Factory 2\Effects folder, once you've unzipped them, if it works anything like MMF.
Re: Curious on converting pixel shaders to background
Great stuff :)
You should really post them here but I don't know if you are allowed to - if not, PM Jeff or somebody from the team, they'll do it.
Re: Curious on converting pixel shaders to background
You need to install the lens shader (looki) as well as the squeeze shaders I posted in order to run that MMF. Running it without them will make the effects fail. The shaders should be located in your folders:
...\Multimedia Fusion 2\Effects\ShaderPack\Morphing\Lens.fx
...\Multimedia Fusion 2\Effects\Squeeze.fx
...\Multimedia Fusion 2\Effects\Squeeze Filter.fx
Quote:
Originally Posted by Looki
Great stuff :)
You should really post them
here but I don't know if you are allowed to - if not, PM Jeff or somebody from the team, they'll do it.
Yeah I'll PM one of em :)
Re: Curious on converting pixel shaders to background
Nice work Pixelthief these are some cool effects thanks :D
The shaders can actually be placed in any folder as far as i know just as long as they are in the main Effects folder. I made a folder called 'Pixelthief Effects' and they are running fine.
One thing i did notice though was at first i got the same thing as the image posted above then realized it was running in MMF standard. Annoyingly HWA .mfa don't open instantly with HWA when double click so sometimes it can open in standard mode when run. This is why i think the separate filename idea someone requested once would be good as it would automatically link to HWA when run.
By the way if anyone does have it opening in standard to fix this simply load HWA though the icon and then import the mfa rather than trying to double click load it.
Re: Curious on converting pixel shaders to background
I set my computer to associate .mfa files with the HWA version :p