Advertisement

Where to start at learning shaders?

Started by May 31, 2015 05:56 PM
20 comments, last by 3Ddreamer 9 years, 7 months ago

Can you learn shaders well with just a basic understanding of 3D in XNA?

basically I just want to make a 2.5D game where I can put a character sprite and have some lighting effect.

Can you recommend a good book that you have read about HLSL shaders?

Thanks

Hi, assuming you use d3d9 (using XNA), you could start with the book: "The complete HLSL and effect guide".

It gives you some good basics (no special 'effects' though).

Another good place might be:

http://www.catalinzima.com/xna/tutorials/crash-course-in-hlsl/

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

Thanks. Catalin zima tutorial is from 2.0 :(

basically I just want to make a 2.5D game where I can put a character sprite and have some lighting effect.


What kind of lighting effect?

You can do alot more with shaders if you render in 3d, even if it's a 2d game with a top down camera.

I'd start with nonogame/xna or opengl/opentk.

What I have in mind is that for example a character sprite is holding a torch. Then I will use point light to light the area. that will also come with shadows (only 2D same as catalin Zima, although that is xna 2.0). Then Ill use tiles with normals to make the light area looks cool. Its not a full game. Its just that I want to make those.

I am using XNA 4.0 and my target shader model if posible is 2.0

3D is not my thing. I just want to make 2D as much as posible with some cool effects(shaders). But then most tutorial use 3D.

I know theres Unity but I want to minimize the amount of abstraction that I can use to make simple games. So I just choose a framework(XNA/Monogame).

Thanks. Catalin zima tutorial is from 2.0 sad.png

Can you explain what you mean "from 2.0?" Do you mean XNA 2.0? If so, that has nothing to do with learning HLSL.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Advertisement

Yes what I mean is 2.0.

So it doesnt matter what XNA version because HLSL are always the same?

Here is a port of the old dynamic shadows example to xna 4.0

http://www.catalinzima.com/2013/01/dynamic-2d-shadows-for-windows-phone-7/


So it doesnt matter what XNA version because HLSL are always the same?

Well... yes and no.

First, most of HLSL that you'll likely be learning about (if you stay away from advanced stuff), you'll be able to use with XNA 4.0.

Second, from what I understand, XNA 4.0 supports up to shader model 3.0. [ Can someone confirm/refute that? ] That link should give you an idea what "shader model" means, It's basically a set of hardware and software limitations. Again - when you're just starting into shader programming, you probably won't have to worry about those limitations. Later on, when you want to use larger buffers, or more instructions, etc., you may have to check if your video card and XNA 4.0 support what you want to do.

As mentioned, which shader models can be used are determined by both hardware and software. I.e., some old video cards may limit you to lower version numbers. However, if you have a video card that supports the latest shader models, you may still be limited by whatever maximum shader model version XNA supports.

For now, I suggest you go happily along, trying out simple shaders, learning the language, and how to use shaders with XNA. Even if shader model 3 is the max you can work with, you'll still be able to do some really nice stuff.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.


For now, I suggest you go happily along, trying out simple shaders, learning the language, and how to use shaders with XNA. Even if shader model 3 is the max you can work with, you'll still be able to do some really nice stuff.

Im kind of confuse about your simple shaders :D. Do you mean like lightings and shadows stuff?

This topic is closed to new replies.

Advertisement