[C++][DX9c] Advancing shader development

Started by
3 comments, last by zyrolasting 14 years, 1 month ago
I'm still writing HLSL in text files and repeating myself often. I want to move on, but like always, there is no "Go This Way" in the D3D documentation or Google. What is a good reference for a shader novice to advance to compiling effects to files and making reusable shader code?
Advertisement
Not sure of any good references. But what I do for common code is just like you would in C/C++. I simply use #include to include common functions and variables. I also use #ifdef/#endif/#define to specify what I want to use from a header - because not all shaders will want all common functions when being compiled.
Nice. What about compiling shaders for later use? Custom data is also a factor here, since I have seen modern games with "shader" directories with extensions I do not recognize.
I haven't really found the need to compile any of my shaders so I can't really say on that one. I leave them in straight HLSL. The extensions might just be a way of organising different fragments but could all be the same format if viewed in text editor. If not then I'm not sure, I use the extension .fxh for my effect headers. I have seen extensions of vsh and psh for vertex and pixel shaders.
Thank you for the useful info! Someone elsewhere told me to look into ID3DXEffectCompiler, so I'll be going into that.

This topic is closed to new replies.

Advertisement