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
XNA can use sm3

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

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

@cozzie - "XNA can use sm3 [ shader model 3 ]" Thanks.


"simple shader" ... Do you mean like lightings and shadows stuff?


That's a fair question - what I meant by "simple" is coding within the limitations of the shader model, not what effect is intended.

That is, there are many ways to do lighting and many ways to generate "shadows," depending on the desired result. More advanced techniques may exceed the limitations of the shader model. However, if you start with examples (some links given above and what you find when you google) for XNA 4.0 (or older), or the example states it's for shader model 3 (or older), you're probably good to go.

With regard to the difference between the language and shader models: Think of learning HLSL in a way similar to the way you learned C#. The general form of C# is common to many APIs. You then learned how to program within the limitations of XNA 4.0. I.e., most coding was probably fairly straight forward and you could do the things you wanted to. Eventually you advanced to the point where you asked yourself "How do I code that in C# within the XNA 4.0 framework?" You searched a bit and found ways (or not) to do more advanced things.

Similarly, you'll learn the general form of HLSL code. Eventually (but probably not very soon) you'll have to consider how to code HLSL with the limitations of SM 3.

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

Thanks everyone.

Ive search google for hours. Downloaded some source check it . Turns out I over estimated my self. There are things that is far from my understanding. Especially the shadows, I look at catalin's shader effect file and yeah I cant understand whats going on. If I am struggling this much then Im not ready for it :D.

There's no point in learning if I just copy and paste some code, I may have well use an engine instead of doing that. My goal for now is to learn, then use an engine when I have an understanding of whats going on underhood even if its just the most basic one, it doesnt matter.

I figured Ill step back a little and try to be comfortable with 3D stuff. Cause Im not really comfortable of using matrices and vectors although I know why they are used. For HLSL, it depends if Im going to buy a book or rely on tutorials on net. For now, Ill just have to be comfortable with 3D.

You'll probably need tutorials or a book for that too :)
The frank D luna d3d books cover both vector/matrix and math basics and getting used to 3d, including shaders

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

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

When I first wanted learn about shaders I had the same problem that I couldn't find where to start. I didn't know enough about graphics pipeline and most of the resources I found was talking about how to write shaders, their syntax, types, usage etc. but not how to connect them to a material or how to setup required resources ( textures, matrices, parameters ). At that time, shaders seemed really confusing to me without looking at the big picture and I struggled every time I tried doing something new.

I suggest you to choose DirectX or OpenGL ( OpenGL might be little easier in the beginning ) and learn graphics pipeline first, how to set/get matrices, how texture resources are created and used, how to draw basic primitives etc. After you grasp the fundamentals of the pipeline and see the big picture, you will understand where exactly shaders stand and it'll be much easier to use them.

I hope this works well for you!

When I first wanted learn about shaders I had the same problem that I couldn't find where to start. I didn't know enough about graphics pipeline and most of the resources I found was talking about how to write shaders, their syntax, types, usage etc. but not how to connect them to a material or how to setup required resources ( textures, matrices, parameters ). At that time, shaders seemed really confusing to me without looking at the big picture and I struggled every time I tried doing something new.

I suggest you to choose DirectX or OpenGL ( OpenGL might be little easier in the beginning ) and learn graphics pipeline first, how to set/get matrices, how texture resources are created and used, how to draw basic primitives etc. After you grasp the fundamentals of the pipeline and see the big picture, you will understand where exactly shaders stand and it'll be much easier to use them.

I hope this works well for you!

Glad someone had gone through it. I have done some drawings on primitive but its just a triangle. but in this age, do people even draw in primitive shapes? I mean there's already a 3d software for that. Actually Im planning to just use an exported model then I will make the shaders.

I found was talking about how to write shaders, their syntax, types, usage etc. but not how to connect them to a material or how to setup required resource

THIS! THIS! THIS! Thats why I am so confuse. :D

About Directx or Opengl. I will go to Directx cause it seems a little bit easier i think.

learn graphics pipeline first

Wait wait wait, Uhm are referring about the Fixed fuction pipeline? I dunno cause isnt that today we are using a programmable pipeline. So uhm are you referring about learning the vertex shaders, and pixel shaders?

how texture resources are created and used

I have totally no idea about this topic. Do you any bookmark links that show or explain this?

Advertisement
The book I mentioned covers it all in a good learning curve

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

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

If you are okay learning OpenGL, you night want to learn from my educational C# 3d library, SimpleScene.

It implements basic 3d rendering, wavefront.obj rendering, shadow mapping, particle systems, and skeletal animation, in as simple a manner as possible.

There are no tutorials, but the code is fairly well commented, easy to build and experiment with.

http://www.codeproject.com/Articles/798054/SimpleScene-d-scene-manager-in-Csharp-and-OpenTK

https://github.com/jeske/SimpleScene

The book I mentioned covers it all in a good learning curve

Hey uh was planning to buy the book. Do you think If i buy d3d11 book i can use it on xna? cause xna is dx9.


It implements basic 3d rendering, wavefront.obj rendering, shadow mapping, particle systems, and skeletal animation, in as simple a manner as possible.

Hi,

I was just curious if that project reached the level where a 3D model formatted in obj (but made in any 3D software) could be imported into it.

Personal life and your private thoughts always effect your career. Research is the intellectual backbone of game development and the first order. Version Control is crucial for full management of applications and software. The better the workflow pipeline, then the greater the potential output for a quality game. Completing projects is the last but finest order.

by Clinton, 3Ddreamer

This topic is closed to new replies.

Advertisement