Jump to content
  • Advertisement
Sign in to follow this  
Dragon_Strike

Shader System

This topic is 3798 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 know alot of posts have been done on this topic but i need abit mroe specific tips... ive looked at the thread were yann describes the dll system where u create alot of different shaders as classes stored as dlls... and that works fine.. but i find it very unflexible... since u have to create TextureShader, TextureBumpShader, TextureBumpDiffuseShader... etc... i was think of some kind of shader plugin building system... where i have "effects" describing different functions... Texture, Bump, Diffuse... and then have the engine build the real shader... BaseShader(new TextureShaderImpl(new BumpShaderImpl(new DiffuseShaderImpl))); and then the engine would build a effect file.. something like struct PSState { float4 color; float3 normal; float2 texcoords; }; void Texture(PSState state) { // change color } void Bump(PSState state) { // change normal } void Diffuse(PSState state) { // change color } float4 PS(PS_INPUT psInput) : SV_Target { PSState state; state = // input; Texture(state); Bump(state); Diffuse(state); return state.color; } well thats the basic idea... but im unsure how i should go about implementing it... any suggestions?

Share this post


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