www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: MichaelJPCT on June 05, 2017, 08:31:36 am

Title: shared shader but unshared uniform parameter?
Post by: MichaelJPCT on June 05, 2017, 08:31:36 am
http://www.jpct.net/forum2/index.php/topic,3965.msg27866.html#msg27866

i search the forum and found the above thread and maybe it's the same question as i have.
i hope to use 1 shader instance for multiple objects but their uniform parameters are different.
is the solution in the above thread the only solution?
is it more troublesome than using 1 shader for each object? is it worth the trouble?
Title: Re: shared shader but unshared uniform parameter?
Post by: MichaelJPCT on June 06, 2017, 06:50:56 am
i found that it's not too much trouble.
Title: Re: shared shader but unshared uniform parameter?
Post by: EgonOlsen on June 06, 2017, 07:42:29 am
You can use an http://www.jpct.net/jpct-ae/doc/com/threed/jpct/IRenderHook.html (http://www.jpct.net/jpct-ae/doc/com/threed/jpct/IRenderHook.html) implementation und override the setCurrentShader() method in that one.