ok following tutorial water reflection xna , when adjust code monogame cant final result. here loadcontent code:
protected override void loadcontent() { spritebatch = new spritebatch(graphicsdevice); texture = content.load<texture2d>("test"); effect = content.load<effect>("linearfade"); effect.parameters["visibility"].setvalue(0.7f); }
and draw code:
protected override void draw(gametime gametime) { graphicsdevice.clear(color.cornflowerblue); spritebatch.begin(spritesortmode.immediate, blendstate.alphablend); //effect.currenttechnique.passes[0].apply(); spritebatch.draw(texture, new vector2(texturepos.x, texturepos.y + texture.height), null, color.white * 0.5f, 0f, vector2.zero, 1, spriteeffects.flipvertically, 0f); spritebatch.end(); spritebatch.begin(); spritebatch.draw(texture, texturepos, color.white); spritebatch.end(); base.draw(gametime); }
and .fx file: linearfade
so problem starts when apply effect. texture disappear , if comment effect part in draw method mirror image fade (messing alpha "color.white * 0.5f") without fade effect have on tutorial middle of picture bottom of picture. still dont have experience in monogame , shader learning.
if any1 know how fix or how make on tutorial above nice. btw sry bad english not main language.
ok no need got after 2 day of thinking know answer. thing need default vertex shader input , output , shader working. if any1 have problem shaders in monogame first see if have default vertex input , output. put solution code if some1 doing same tutorial or similer thing know problem.
solution: working effect.fx