(Note @ moderators: Originally I was going to host these externally, but decided it would be better to embed them into TGC forums. I hope the two threads aren't too much of a hassle, if so, you may delete the other one and I can append it to this thread instead.)
I've had these as a draft for a while. Big shoutout to Green Gandalf for reviewing them and giving me feedback!
Your feedback is highly valued in order to improve the quality of these tutorials, so if you have any feedback, please post below.
Shader related questions should be directed to the existing shader thread.
[EDIT] Apparently that was locked. Unlock?
TheComet's Shader Tutorials 101
Outstanding Support Provided by Green Gandalf
Master Post
Introduction
Shaders are still considered by many in the DBP programming community a form of black magic. There's no easy entry point for the total beginner, and the existing shaders aren't very helpful due to the lack of comments and sheer amount of mathematics in the code.
These series are my attempt at making it easy for the total beginner to start programming shaders by shallowly introducing you to basic concepts and techniques.
What will I need?
You will need a DBP compiler. DarkShader is a nice-to-have, but it's not necessarily needed to get through these tutorials.
In order to benefit the most from these series,
download the examples, and try to understand them as you read the tutorials. Also feel free to do your own experiments! There's no better way to learn than by doing.
Do your experiments in the folder
PLAYGROUND in the examples you downloaded. It contains a basic shader program loaded by DBP, and is intended to be used for all of your testing/experimenting. This way, you aren't changing the examples,
Tutorial Content
Ground Zero
* 01 - The Graphics Pipeline - Learn what the GPU is and how it works, and when it makes sense to use the GPU over the CPU.
* 02 - Writing Your First Shader - Introduction to HLSL. Writing your very first shader. What are shader semantics? How are vertices projected?
* 03 - Vertex Shader Coordinate System - What coordinate system is used? Why are the coordinates 4-dimensional?
* 04 - Vertex Normals - What are normals? Manipulating vertices using the vertex shader.
* 05 - UV Coordinates - What are UV coordinates? How is a texture mapped to an object?
* 06 - Sampling a Texture - Using UV coordinates to sample a texture using the pixel shader.
Basic Lighting Techniques
WIP
Feel free to leave feedback to help improve the information provided! And always remember: If you run into trouble, the forums are here to help.
Happy shader coding!
TheComet
Your mod has been erased by a signature