RESOLVED: Declaring a uniform in the glsl mat that is set on the renderTOP creates warning on mat

Declaring a uniform in a glslMAT that is assigned on the renderTOP creates a warning on the mat that it needs to be assigned. Not sure if this would be considered a bug or just nearly impossible to resolve…

I really doesn’t understand your problem.
The common place of material is in Geometry Comp, not in Render Top.
And without a little bit more of information: your shader code, where is the uniform referenced, vertex, geometry, pixel shader? float, vec2 …? How its used in the code? etc.
The best would be to post the project or at minimum a capture and the shader code.
Have you followed a tutorial on how to do it?

1 Like

@jacqueshoepffner FYI you can assign GLSL uniforms on the Render TOP, see documentation:

Also I would say Keith is in the top-10 of TouchDesigner pro experts in the world, I don’t think he needs a basic tutorial :wink:

1 Like

Thank you @jacqueshoepffner for your effort to help. Fortunately this isn’t really a functional bug, everything works it’s just not ideal to see a warning flag when nothing is wrong…

As @nettoyeur mentioned below, you are able to set global uniforms that are accessible by the shaders of all the geo being rendered by a renderTOP. It’s actually quite a useful feature that can save both development time and CPU cycles by only needing to set references, bind or exports all in one spot if all your shaders need the values. Another really useful feature is the Override Material on the Advanced page of the renderTOP where you can override all mats of all geos being rendered.

@nettoyeur @keithlostracco
Sorry, I was just trying to help. The question was a little bit obscure and I doesn’t learn about the top 10.
Accept my apologies please.
Jacques

1 Like

Not sure if there is a good way to solve this. The MAT could be used in one Render TOP that has them set, but another that does not. It’s likely good practice to have these values set to some ‘default’ value in the MAT so that if the MAT is used in a Render TOP that isn’t setting them, they have a valid value.

Ah yeah that is good solution, I didn’t realize setting a default value inside the shader would resolve the warning… I’ll do that.

I thought that setting the uniform on a par on the mat then also on the renderTOP par which would then take precedence but that wasn’t the case.

The default value in shader sounds like the best solution.

Thanks Malcolm.