Home › Forums › Programming › Multiple shaders on single objects
- This topic has 7 replies, 5 voices, and was last updated 17 years, 1 month ago by
Anonymous.
-
AuthorPosts
-
-
November 26, 2005 at 2:09 pm #4826
Anonymous
InactiveHi 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:
-
November 26, 2005 at 10:54 pm #27711
Anonymous
Inactivei 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. -
November 28, 2005 at 11:41 am #27738
Anonymous
InactiveThat 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 :)
-
November 28, 2005 at 11:45 am #27739
Anonymous
InactiveHow 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.
-
November 28, 2005 at 11:52 am #27740
Anonymous
InactiveHow 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.
-
December 12, 2005 at 4:02 pm #28264
Anonymous
InactiveFor 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.
-
December 20, 2005 at 10:54 am #28474
Anonymous
InactiveHow 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?
-
April 14, 2006 at 9:03 am #30943
Anonymous
Inactiveyou 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
-
-
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.