Shader uniforms capacity #1625
-
Hello, I read some opengl about the limitations of passing a huge amount of data as uniforms to a shader.
As an example, let's say I have a single shader rendering a scene by computing 800 complex shapes analytically (described as DrawRectShader(screenWidth, screenHeight, sceneShader, optsUniformsOf800shapes) Currently I'm going with: for _, e := range entities {
DrawRectShader(e.Width, e.Height, entityShader, optsWithFewUniforms)
} But this is really gpu intensive, and shouldn't require multiple shader invocations. How should I solve this problem with these constraints using Ebiten ? Thanks in advance ! 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Disclaimer: I'm not an expert shading-language programmer. This depends on how much uniform data you need, but in general, using a texture as a data array is the only way to go so far.
Yes, the precision might matter. Could you give an example of the shapes data you want to pass to the shader? |
Beta Was this translation helpful? Give feedback.
Disclaimer: I'm not an expert shading-language programmer.
This depends on how much uniform data you need, but in general, using a texture as a data array is the only way to go so far.
Yes, the precision might matter. Could you give an example of the shapes data you want to pass to the shader?