I was just wondering if it would be feasible to make a texture editor that used post processing shaders for the majority of it's functions. Downside would be that users would probably want PS 2.0, but wouldn't doing effects/filters be faster and easier to code using shaders?
A sin wave distortion would be as easy as
sampler TextureSampler : register(s0);
float4 PixelShader(float2 texCoord : TEXCOORD0) : COLOR0
{
texCoord.y = texCoord.y + sin(texCoord.x*100)*0.01;
return tex2D(TextureSampler, texCoord);
}
technique Wave
{
pass Pass1
{
PixelShader = compile ps_2_0 PixelShader();
}
}
[EDIT]
And does anyonw happen to know a better value wrapping method than
((x + 1) % 1) (which assumes the value will not go lower than -1, which it won't in my case)
I'd just need to throw in a few adjustable values.
[EDIT2]
It would also be easy for users to add new functions, without the need to implement some sort of scripting language. It would be relatively easy in XNA/C# if there was a way to get around the fact that it compiles shaders at compile time...hmmm...
[EDIT3]
Well I found a way around the compile time building of effects, now the only question is: is it worth making something like this...
(And if someone will eventually look at this thread and post something...
)
[EDIT4]
Just thinking some more...it would also make it rather easy to procedurally generate textures as well, assuming that the user has PS 2.0...why does that have to keep popping up....how many people actually have PS 2.0? just wondering... (if someone will post something so that I can stop putting in all these edits...)
So either nobody likes 2D Chat or nobody likes my idea...or both
Ok...judging from the amount of response I'm getting, I'll take that as a 'no' for now and go work on something else...