Question about Uniforms

I am drawing a Viewing Frustum by JS and highlighting inside the Frustum by Fragment Shader. It was succeeded by one Frustum. I passed coords and matrix by uniforms with Cesium.CustomShader.
However, multi numbers of Viewing Frustums are so difficult. I couldn’t pass any List or multi coords by uniforms.
I wonder if you could give any idea or solution for this problem?

Hi @keiichi.nakamura,

I’m not sure I’m clear on what problem you’re seeing. Would you mind explaining further? Maybe include a Sandcastle example?

The Custom Shader Guide includes details on the types of uniforms you can pass to a Custom Shader.

Thank you very much for replying this issue.
I realized drawing one Viewing Frustum(Pyramid) and highlighted inside the Pyramid using Fragment Shader. However, I could pass the coordinate of the Frustum Center and convert matrix, then I couldn’t pass multi numbers of those coordinates by customShader uniforms.
Now I’m trying to make uniforms including multiple coordinates.
I make these Java Script and GLSL Shader Code separatedly and local environment. How can I realize this situation on Sandcastle?


This is a picture I’ve realized by Shader. I would like to make this Pyramid many numbers.

Hi @keiichi.nakamura,

If the number of pyramids is defined, I would create an individual uniform for each.

If the number of pyramids is arbitrary, you could try packing the coordinates into a texture. That texture can be passed as a uniform to the shader.

Thanks a lot.
I will decide the number of pyramids and make those uniforms dynamically.
I would like to know the limitation. How many numbers of uniforms I could set? I would like to ask the maximum numbers of uniforms?

The maximum number of uniforms depends on the hardware. You can see the maximum number supported by your particular graphics card at https://webglreport.com/.

Thank you very much for appropriate support. I could realize multiple frustums, and also check the capacity of uniforms.
We can close this topic.

1 Like