Home Forums Programming Multiple shaders on single objects

  • This topic has 7 replies, 5 voices, and was last updated 18 years ago by Anonymous.
Viewing 7 reply threads
  • Author
    Posts
    • #4826
      Anonymous
      Inactive

      Hi good people!

      Im sitting here and writing on my game engine, and now I want to
      do my shadermanager part of the engine more efficient and more advanced. 8)

      My intention was to have a shadermanager that allows to have multiple
      shaders on every object from a list. (shadows and such).

      Now to my problem. Is there a “right” way to do this?
      Every shader needs different inparameters to different objects and so on.
      Is there a way to make this, or any good page with information about this?

      So far, Im only using one shader, and it feels to pathetic to fill one shader with all kinds of PS, so that is not really an option. :roll:

    • #27711
      Anonymous
      Inactive

      i would say theres no right or wrong way. try to gather all your types of shaders your going to have as well as a list of what objects will use which then try to write as generic a manager which works for all these. then if you need additional functionality just extend this manager.
      dunno if that helps. just the way i would do it.

    • #27738
      Anonymous
      Inactive

      That is a good idea, having specific functions for different shaders.

      But the main thought was, that I want to have a dynamic manager.
      So if I add a new shader, I dont have to add another function to my lib.
      Dont know if that is possible, unless I add the function in the game logic,
      instead of the lib. :?

      In the meantime, I will take your advice, and make specific functions :)

    • #27739
      Anonymous
      Inactive

      How about adding a scripting language as well, like python or lua to enable the addition of extraneous functions without having to go back into the core code.

    • #27740
      Anonymous
      Inactive

      How about adding a scripting language as well, like python or lua to enable the addition of extraneous functions without having to go back into the core code.[/quote:e080830801]

      thats actually a good idea. probably a good way to go.

    • #28264
      Anonymous
      Inactive

      For ease of asset creation, you could try pinning the shader values to virtual textures, which could be applied to the object using a stand-in bitmap in the modelling programme.

      The UVW coordinates of the virtual textures then define what part of the object is to be shaded.

      I’m not exactly au-fait with shaders, so please don’t berate me if I’m spouting gibberish.

    • #28474
      Anonymous
      Inactive

      How about adding a scripting language as well, like python or lua to enable the addition of extraneous functions without having to go back into the core code.[/quote:8b2ca6aa5e]

      That would be the best way to go, but I think it is a little bit too much for me to develop right now. But still a good idea.

      For ease of asset creation, you could try pinning the shader values to virtual textures, which could be applied to the object using a stand-in bitmap in the modelling programme.
      The UVW coordinates of the virtual textures then define what part of the object is to be shaded. [/quote:8b2ca6aa5e]

      Hmm.. Interesting, that could work for using multiple shaders.
      Im going to try that one as soon as I am done with the animationsystem :)

      But how do I practically run several shaders on a single object, is it just as simple as adding a additional iPass in the shader render function?

    • #30943
      Anonymous
      Inactive

      you could check out how Valve did it on Source? They had this _huge_ Powerpoint presentation about their shader technology.
      It’s a PDF file called D3DTutorial10 half life 2 shading, dating from 22nd of March 2004. Very interesting, even for me who is only a beginner with shaders.
      Hope this helps

Viewing 7 reply threads
  • The forum ‘Programming’ is closed to new topics and replies.