Sign in to follow this  

Shader System

This topic is 3490 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

This topic is 3490 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.

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