Pixel Shader Examples Tutorials video [Code Links Reference]

For reference. Im going to post a bunch of Links to Shader resources or example posts ect.

So i can or others can just link to this post when someone asks about getting started with shaders.
Feel free to add to this if you want, just make sure you test it first to make sure it works.

You should of already read or browsed this (_adding_content.html). If you want to add a new pixel shader to monogame from scratch particularly if you have never before added a … new item > of type effect. (using_mgcb_editor.html). By using the content pipeline tool after creating a new MonoGame project. With that out of the way.


If any of the above is confusing apos made a alternate getting started tutorial found here.
Apos basics for getting started with monogame.


I suggest getting a single example shader up and running once your able to add and edit a shader as described above the below is a dead simple shader.
Writing your own 2d pixel shader in monogame for absolute beginners
Then to start looking thru other shaders in the list of links.


I posted a second example ( copy pastable ) as well at the bottom of the write your own first shader topic.
Though you will need to create a new game project a effect and then copy in the shown code and possibly change the namespace to your projects namespace and the game name in program.cs that should be obvious but in case its not.

4 Likes

Websites


This is a link to simons port over of the excellent Reimers tutorials in order to preserve them they entail shaders and many things comparable to or better then the rbwhitakers tutorials.
2D Series and 3D Series 1 thru 4 … plus articles
This is his xna archive with more stuff a great resource.


This is a site that has lots of basic instructions on getting started with monogame it includes working with shaders. Though sometimes it doesn’t connect the dots as well as it could.
http://rbwhitaker.wikidot.com/xna-tutorials
http://rbwhitaker.wikidot.com/monogame-tutorials
http://rbwhitaker.wikidot.com/hlsl-tutorials


Video


If you like videos batholite did a whole video series and here is his shader video.


Simons.


The monogame team vid site lots of video tutorials here.


Alien scribbles videos for making models for use with the existing monogame model class and other stuff…


Topics on the forum.
Most of these i put both Game1 and Effect shader code examples in them.


My minimal Grey scale example shader very small copy paste (spacebar cycles the amount of grey scaling when you run it).


Using triangles (two for a rectangle) directly with DrawUserPrimitives to draw geometry. I mimic spritebatch including using the matrix class to get a projection and view matrix. A diy (do it yourself) from scratch example. The second example here uses a Shader.


Post with a clip shader copy pasted at the bottom here that mimics scissors and a bit more.


Refraction shading lots of little examples are here and they are pretty cool. Some what more complicated because of how many techniques and functions i stuck in the shader. This relys on displacing texel coordinates primarily.


Shading and blending more then one image using a pixel shader. Texture scrolling as well.


Tilemaping and shaders multiple people chime in here. I post a general example.


Nkast here also links to his VTF shader example on the subject, a powerful gpu technique for speeding things up and doing all sorts of stuff.


Instancing quads at the bottom of the topic and drawing particles in various ways. This is a more difficult shader that allows for hundreds of thousands or more draws per frame using the shader.


Links
More advanced stuff or other posts here.


Prime31’s nez shaders many examples.


Here is my own github shader examples project though its not done yet


source for Kosmonaut3d DeferredEngine
The above is the source for a topic >>Here<< on the forum that entailed more then 350+ responses. It’s all about shaders..


This is a link to a list of resources that entails all sorts of things.
https://github.com/UnterrainerInformatik/GameDevelopmentLinks
https://github.com/UnterrainerInformatik/GameDevelopmentLinks#hlsl-shaders


Gpu gems the fx files are downloadable.


Mr graks video blog

2 Likes

Reserving this area as well for more links.

1 Like

All of Riemers tutorials have also been migrated to the XNA archive and the first 3 have also been upgraded to MonoGame :smiley: