Sign in to follow this  
zyrolasting

[C++][DX9c] Advancing shader development

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this