Thanks for the quick response!
I was kind of afraid that would be your answer. I was hoping the others who posted how they were doing their transforms in GLSL were missing something.
So to make sure I understand, you would do something like this:
<python, in task run each frame>
uniform mat4 transform_mat;
I tried that, but it gives me an error:
AssertionError: Shader input transform_mat is not a nodepath.
Upon further research, it looks like I would get around that by putting that mat into a dummy node and passing that? Like:
dummy = node.attachNewNode("dummy")
Is that the idea? I will give it a try.
As far as using the devel version…
Do you know if there are plans to roll the addition of those GLSL inputs into a standard release anytime soon? From the dates on some forum posts, it appears they were available in the devel version before the release of 1.8.1, but then 1.8.1 didn’t include that change. Maybe I am mistaken?
I understand the reasoning behind not wanting to include a hard-coded variable name solution that you might want to phase out, but despite it’s rigidness, it is incredibly powerful and easy to use.
A longer term solution might be something like this:
node.setShaderInput(“a_transform_mat4”, (from_node, to_node))
where from_node and/or to_node could also be a keyword or const like “world” or “view” etc. which could allow all the functionality of the old Cg method without hard coding variable names.
node.setShaderInput(“trans_model_to_view”, (node, “view”))
would be an example of how you would recreate a trans_x_to_y input using that suggested syntax
just an idea
For now, just having the fixed named inputs in GLSL would be awesome. But I wouldn’t want to do that unless it was probably going to be rolled into an official release. Any idea on that?
Thanks again for your help.