Is it possible to input an array into a .effect file? How does gs_effect_set_val work? #10736
Unanswered
ac2522
asked this question in
Development Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If I have
uniform float2 points[26];
, is there any way to initialize these values?points_cpp is a vec2[26] within my c++.
gs_effect_set_val(pointsParam, points_cpp, sizeof(points_cpp));
error: Parameter 'points' set to invalid size 208, expected 8
gs_effect_set_vec2(pointsParam, points_cpp)
error: gs_shader_set_val (GL): Size of shader param does not match the size of the input
error: effect_setval_inline: invalid param
Maybe I've missed something, but I can't find a way to input an array, so i'm left to mannually input 26 different points. Which seems a little inefficient, especially if I want to iterate over them within the shader...
I've tried to look for examples of working ".effect" shader files, that use arrays, but the best I could finrd was a commented array:
https://github.com/Oncorporation/obs-shaderfilter/blob/master/data/examples/gaussian-blur.effect
Any help would be greatfully appreciated! I relaize there's a high chance I overlooked something completely obvious....
Beta Was this translation helpful? Give feedback.
All reactions