Hi,
Is it legal to load the same shader (i.e. the same .vert and .frag files) multiple times? I.e. have an abstraction with a [glsl_vertex], a [glsl_fragment] and a [glsl_program], and multiple instances of this abstraction?
I ask this because I did this and pd crashes as soon as I open the gemwin. I had some trivial errors in the shader files before, and I got the compiler error messages without crashes, but then I corrected the error and now it crashes. Obviously there may be a lot of other reasons for the crash but I have to guess.
Is there another way to use the same shader in multiple places? For example, I see [glsl_program] outputs an id in its right outlet: can I perhaps use that ID to use that shader elsewhere? If so, how? In this case, would each "instance" of the shader have its own value of "uniform" parameters?
By the way, I should probably ask a more basic question: is it legal to have more than one [glsl_program]s (meaning a [glsl_vertex] a [glsl_fragment] and a [glsl_program]), no matter whether with the same or different shader programs, "under" the same [gemhead], provided that they are in different "subchains" with [separator]s?
Thanks m.
Matteo Sisti Sette escribió:
I ask this because I did this and pd crashes as soon as I open the gemwin. I had some trivial errors in the shader files before, and I got the compiler error messages without crashes, but then I corrected the error and now it crashes.
Well for the moment, by testing the shader in a simple test patch, I've found out more trivial errors in the shader code, in particular calling an undefined function. Shouldn't crash anyway...
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matteo Sisti Sette wrote:
Hi,
Is it legal to load the same shader (i.e. the same .vert and .frag files) multiple times? I.e. have an abstraction with a [glsl_vertex], a [glsl_fragment] and a [glsl_program], and multiple instances of this abstraction?
yes, i'm using this myself.
I ask this because I did this and pd crashes as soon as I open the gemwin. I had some trivial errors in the shader files before, and I got the compiler error messages without crashes, but then I corrected the error and now it crashes. Obviously there may be a lot of other reasons for the crash but I have to guess.
obviously it shouldn't crash at all. could you post the crashing patch? (preferrably in the sf bug tracker)
Is there another way to use the same shader in multiple places? For example, I see [glsl_program] outputs an id in its right outlet: can I perhaps use that ID to use that shader elsewhere? If so, how?
i don't think it's currently possible to use the ID output by glsl_program. good idea though.
By the way, I should probably ask a more basic question: is it legal to have more than one [glsl_program]s (meaning a [glsl_vertex] a [glsl_fragment] and a [glsl_program]), no matter whether with the same or different shader programs, "under" the same [gemhead], provided that they are in different "subchains" with [separator]s?
it's legal, even without your restriction.
fgmasdr IOhannes
IOhannes m zmölnig escribió:
obviously it shouldn't crash at all. could you post the crashing patch? (preferrably in the sf bug tracker)
Sorry for forgetting about this thread (which I started). After finding and removing more errors in the shader code (which actually prevented it from compiling but also caused the crash so I couldn't see the compile errors) it stopped crashing. An "isolated" version of the patch with just the offending shader won't crash (it displayed the errors, that's how I found them).
I'm not sure I can reproduce the crashing version. Even if I can, in these cases I don't know what to post in the bug tracker: a bug report titled "gem crashes with this patch" and attached a complicated and unreadable patch?
Thanks for the answers; indeed I guessed the multiple-shader thing is legal since it almost works - now I'm having problems (I think) with correctly indexing textures with "texunit" when pix_snap is used.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Matteo Sisti Sette wrote:
IOhannes m zmölnig escribió:
I'm not sure I can reproduce the crashing version. Even if I can, in these cases I don't know what to post in the bug tracker: a bug report titled "gem crashes with this patch" and attached a complicated and unreadable patch?
well, then send me your complicated and unreadable patch so i can confirm that it is a bug in Gem or not, and eventually fix it.
the title of the bug report shouldn't hinder you to report, as it can be easily changed later to something more meaningful (even after the bug has been detected and fixed)
masdr IOhannes