(instead of the blurred image i just get a colored Rectangle)
I really need this effect, please help
Edit: The only change i’ve made is chaning
PixelShader = compile ps_2_0 PS_GaussianBlur();
to
PixelShader = compile ps_4_0 PS_GaussianBlur();
… does this have any effect?
Edit2: This seems to apply to any shader i try
Edit3: Okay, just wrote the most simple Pixel shader, thats just gets the color and returns it as it is. Still not working. My guess is that the TEXCOORD0 is not working, and always returns the first pixel
I know almost nothing about shaders but I will try to help.
Can you show your code? (How you begin your spriteBatch how you apply your effect and how your .fx file looks like).
Hi, thanks for trying to help!
My code is really complicated atm, but please try to create a basic effect in Monogame (current version, no opengl) and check if it works! (it doesn’t here)
Sounds like you are not exactly matching the output of the vertex shader to the inputs of the pixel shader. The pixel shader inputs must match exactly… even parameters you do not use in the pixel shader.
Be sure to read the effect writing tips in the docs too…
@thecrow34: Could you be so kind and upload me a simple Test game? Woudl be super awesome @Tom: I’m don’t have any experience in shader programming - but I do not use a vertex shader so i just use float2 coords: TEXCOORD0 as pixel shader function parameter
I think i’m doing something very basic wrong here. If someone could upload a DirectX sample i would really appreciate it!
Yes… the basic thing you are missing is that there is always a vertex shader. In this case I assume you are rendering with SpriteBatch. When you provide SpriteBatch with a custom effect with only a pixel shader, the vertex shader from the stock SpriteBatch effect is used.
You can see here how the pixel shader for the stock SpriteBatch effect is defined:
Edit: Ok, now it doesn’t work at all. i guess i’ll just go to sleep, if someone could upload a simple, working sample with any effect that would be super nice.