좋아, 그럼 내가이 튜토리얼 Water Reflection XNA을 따르고 있으며 모노 게임으로 코드를 조정할 때 나는 최종 결과를 얻지 못한다. 나는 효과를 적용 할 때 LinearFade도움이 필요하십니까 - Monogame 2D 물 반사
그래서 문제가 시작합니다
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
texture = Content.Load<Texture2D>("test");
effect = Content.Load<Effect>("LinearFade");
effect.Parameters["Visibility"].SetValue(0.7f);
}
내 그리기 코드 :
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);
}
그리고 마지막으로 내 .FX 파일 그래서 여기 내 LoadContent 코드입니다. 내 텍스처가 그냥 사라집니다 그리고 만약 내가 그림 그리기 방법의 효과 부분을 언급하면 페이드 효과 (알파 "Color.White * 0.5f"로 엉망이)와 거울 이미지를 얻을 그는 그림의 중간에서 그림의 중간에서 자습서에있는 것처럼 페이드 효과없이 . 나는 여전히 모노 게임과 쉐이더에서 많은 경험을 갖고 있지 않지만 배우는 중이다.
any1이 문제를 해결하는 방법을 알고 있거나 위의 튜토리얼에서 좋아하는 방법을 알고 있다면 좋을 것입니다. Btw는 나의 주요 언어가 아닌 나쁜 영어를 부르짖습니다.