Jump to content
  • Advertisement
Sign in to follow this  
IcedCrow

Using shader files with 2D games

This topic is 2573 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

Greetings all

I am new to the shader world and am working on a 2D game. As of now I have not needed any special effects, but now I am getting into some flame effects, lightning, etc... and I have been running tutorials and the like and am implementing a particle system.

The thing is, a lot of the particle systems I'm looking at are all 3D. I know I can get rid of the Z axis by just hardcoding a 0 but is this neccessary?

Also on shader files... all of the examples of shader files I'm seeing are 3D related. Is there much of a point in using shader files in a 2D game?

Thanks in advance.

EDIT: I am developing using C# and XNA in Visual Studio 2010.

Share this post


Link to post
Share on other sites
Advertisement
Shader files are there to allow you to customise the rendering path to include special effects, fancy lighting or whatever else you can dream up.

They certainly aren't limited to 3D. I've seen some 2D platformers that make extensive use of shaders to achieve funky per-pixel lighting effects.

Here's a gamedev topic I found from June 2009 that you may find useful: http://www.gamedev.n...s-for-2d-games/

Share this post


Link to post
Share on other sites
Thanks guys you are awesome! I kind of figured that was the case, I just couldn't seem to find a good launch point as everything I am seeing tutorial wise is 3D using Vector3 objects and matrices for camera view, etc... which has me a bit off on 2D.

I appreciate the responses.

Share this post


Link to post
Share on other sites
When you think about it, 2D is really just 3D but with everything having the same constant Z. Otherwise the very same principles can apply.

Share this post


Link to post
Share on other sites

When you think about it, 2D is really just 3D but with everything having the same constant Z. Otherwise the very same principles can apply.


Yeah. I get that, I set all of my Z coordinates to 0. I guess the biggest cause of confusion for me is the need to have view camera matrices in 2D (since you really don't). All of the examples and tutorials involve setting those and I dont have those in my game.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!