Jump to content
  • Advertisement
Sign in to follow this  
freeworld

using shaders with xna and 2D

This topic is 2704 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm a bit confused, I've been reading msdn about xna and as I plan to work completely in 2D everything about the sprite objects and spritebatch seem pretty good. Though there's is one thing that caught me off guard.


Sprites are 2D bitmaps that are drawn directly to a render target without using the pipeline for transformations, lighting or effects.
[/quote]

From the msdn site about what sprite objects are, this sounds to me that they are similar to ID3DXSprite, and aren't compatible with shaders, or have no way of using them. Then I look at SpriteBatch and it clearly has a parameters for passing an effect to it. Then reading on the internet, this seems to allow shaders?

So If I desire to use shaders with 2D, will sprites and spritebatch be the better way to go... or should I look into the 3D pipeline?

Share this post


Link to post
Share on other sites
Advertisement
Sprites rendered through SpriteBatch are nothing more than an efficient mechanism for rendering plain old screen space quads. You most certainly can use shaders with them. In fact, the SpriteBatch's Begin() function takes a shader object as a parameter should you want to use one. :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!