These are my first steps into the world of Pixel Shaders.
Suggestions and/or remarks are always welcome.
My goal was to use pixel shaders in Direct3D9.
Unfortunately d3d9.dll ( which is standard present on all windows operating systems from 2003 till now ) doesn't have a shader compiler function.
The fully functional DirectX9 shader compiler function for shader version 3.0 is available in the wrapper libs D3DX9_32.dll up to D3DX9_43.dll.
So I programmed a small ShaderCompiler program that searches if one of the 12 D3DX9_xx.dlls is available on the developers computer and calls the compiler function by using "LoadLibrary" and "GetProcAddress".
The compiled pixel shader code can be saved as pre-compiled GPU code.
The pre-compiled GPU code can be included and executed from your program without the presence of one of the 12 D3DX9_xx.dlls on the end-users computer.
This way we don't bother the end-user with missing D3DX9_xx.dll messages.
As a pixel shader developer your computer must have at least one of the 12 D3DX9_xx.dlls present to compile the pixel shader code.
You can download the latest DirectX9 End-User Runtimes here:
DirectX End-User Runtimes (June 2010)
https://www.microsoft.com/en-us/download/details.aspx?id=8109Shadertoy,
https://www.shadertoy.com/ is a great source to learn pixel shader progamming.
At this moment there are more than 20.000 examples.
You have to convert the WebGL or GLSL to DirectX9 HLSL or GPU assembly.
Here are some great Youtube Video tutorials:
Shadertoy for absolute beginners
https://www.youtube.com/watch?v=u5HAYVHsasc&t=829sThe following 3 examples are also in the source code attachment (converted to HLSL),
Simple3D ->
https://www.youtube.com/watch?v=dKA5ZVALOhsCamera3D ->
https://www.youtube.com/watch?v=PBxuVlp7nuMTutorial palm tree ->
https://www.youtube.com/watch?v=0ifChJ0nJfMA great site about ray-marching:
http://jamie-wong.com/2016/07/15/ray-marching-signed-distance-functions/The attachment contains 2 sources,
The ShaderCompiler source and the ShaderWindow source to execute the pre-compiled pixelshader.
There are 22 examples, most of them I have converted to HLSL from shadertoy examples.