Getting starteted with shaders

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
YeKet
Posts: 2
Joined: Wed Jan 05, 2011 11:38 am

Getting starteted with shaders

Post by YeKet »

I'm using Irrlicht now for a while and want to get into shader programming, especially for opengl.

My question is, how did you start programming your own shaders or does somebody know a good tutorial to start with?
Mag-got
Posts: 42
Joined: Tue Dec 04, 2007 5:53 pm

Post by Mag-got »

http://www.lighthouse3d.com/opengl/glsl/

Helped me a lot with shaders. If you haven't read the tutorials then read them, very helpful

http://irrlicht.sourceforge.net/docu/example010.html

How to apply shaders in Irrlicht
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Learning how to write shaders can be daunting in the beginning (I know this from experience), I remember I kind of felt lost back when I wanted to learn HLSL

I don't know exactly which tutorials I used to get familiar with shaders, but I do remember there were a lot of them

I can however tell you some of the steps you need to take to get a solid understanding of shaders

- Learn what Vertex Shaders and a Pixel Shaders (Fragment Shaders in OpenGL terms) are, know their position in the rendering pipeline, and be able to explain them to yourself

- Get familiar with shader semantics and their purpose

- Understand how World, View and Projection matrices (and other matrices involving these 3 for more advanced concepts) are used to get your mesh from object space to clip space. This is not really essential for the writing of shaders, but you will encounter these matrices a lot, so it's better to know what they're used for

- Get familiar with vector operations (dot- and cross-products, normalization, length calculation, etc.) and learn how to do them in your preferred shader language (All high-level shading languages have pre-defined functions to do these operations)

- Learn how shader constants are handled and how to pass these to the shader in irrlicht (I believe this is documented in one of the examples provided with irrlicht)


To anyone familiar with shaders: if I forgot anything, feel free to add to the list

I don't know what your experience with 3D graphics is, so it's possible you already know parts of this stuff :)

Good luck!
YeKet
Posts: 2
Joined: Wed Jan 05, 2011 11:38 am

Post by YeKet »

Thank you both very much for your answers, I'm sure they'll help me a lot.
Post Reply