Jump to content
  • Advertisement
Sign in to follow this  
zyrolasting

[C++][DX9c] Advancing shader development

This topic is 3163 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

Share this post


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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!