Jump to content
  • Advertisement
Sign in to follow this  

dynamicly resolved shaders, problem with multipass

This topic is 5409 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 have been thinking... and there is a HUGE amount of different materials for a mesh, but how do I process the correct stuff of the material? for exampel a singel textured mesh would go through the "texture bind part" and then be rendered no other steps are needed becouse there are no color etc. it the same mesh above would have a small amount of blue color added to it, then it would go through the "set color and texture bind part" and so I figured out I could split up my material in sections depending on what the material has it would add different "shaders" lets take the first exampel above it has only a texture, this will add a TextureShader that will bind and activate a texturecoord for this texture (this part is stolen from the material/shader implementation-thread a while ago) but then if I then go to the exampel two where it has small amount of blue color added, it will recive two shaders, one wich will set the color and the other that bind's the texture works nice and smooth. so then I come to lighting, I figured that lighting would be a Global shader becouse this "affects" the entire scene, anyway.. if Lighting is on in the RenderState of the RenderSystem it will add the LightingShader to the mesh aswell, this shader will enable the nearest lights of the mesh. and so this worked as well as the above.. and then I added a transparency shader, this would be as an effect shader becouse it will only affect a single object not the whole scene ( at least in my mind :) ) but now I have come to a problem, when I want to do something advanced like mirror,shadow,multitexture(multipass, no extensions) etc. I think that a ShadowShader would be a Global shader becouse shadows belongs to the entire scene not the property of a single material, anyway I don't have a clue how to create a render-path where I first do A, then B, then C. for shadowing would be something like this first pass - render shadow-maps for all requested lights second pass - render ambient light allover the place third pass - render diffuse,specular light but with depthmap comparison that will remove the "shadows" so that the lights will go everywhere but not in the shadows. the problem is that how can I know that in the case above the TextureShader should only go into the second pass(if I understand right) and the LightingShader should go in both the second and third pass, but with different settings? I have found out a way to put a shader in a certain pass, but I don't have a clue how I can force one shader to go in a pass it normaly wouldn't go to.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!