What is the best way to pass a sequence of consistently formatted data as a shadestyle parameter? (or some other way entirely)
I want to be able to iterate over it in the fragmentTransform, but it is more than just a single type that I can put in an array.
What is the best (fastest) way to do this?
(Currently I am using multiple arrays of equal length)
This entry in the guide is what you’re looking for. You can pass custom attributes as attribute("factor", FLOAT32)
and access it in the vertexTransform as a_factor
and in the fragmentTransform as va_factor
. If you use instancing, then you’ll get a value back from it. In the case you don’t use instancing it will be an array afaik.
My problem is I’m already using instancing, but I want every instance to be able to access the entirety of several arrays, some of which are arrays of floats, which can’t be passed as a parameter afaik
According to the source code you can pass uniform arrays.
I completely missed the overload with DoubleArray
. Thanks for linking that. I was trying to use toTypedArray
and it was not working.
Actually, the overload with DoubleArray isn’t available for me. I am using openrndr 0.3.44. Do I need to update or is something wrong for me?
According to git blame it was added 19 days ago and the last release candidate version is 23 days old, ergo you need to use the current code on master
branch. You can check this short description on how to set that up.
Thank you, that worked, however one of the other changes in the snapshot are causing me trouble.
The Application.cursorVisible
property used to prevent the cursor from moving, whereas now if you move it too far, it comes out the side of the window. I can’t find a way to cause the old behavior, will I have to just implement this myself?
Sorry for the constant questions, if there is a correct place to ask this please let me know.
This is the right place to ask questions! Personally I am more responsive on our Slack but I try to get the Discourse ingrained in my system.
I changed the cursorVisible
behavior after reading this: How do I change the cursor image (or stop cursor jumping back to centre)? . I didn’t expect this to be a desired feature but I understand it is now. I will look into something that serves both.
Like @edwin said it’s the right place! Here’s the slack link. Just create new posts when the question diverges from the current, because then you can tag one of the replies as the answer to the post and help other users with the same questions.
Add disableCursor support · openrndr/openrndr@96a7ba6 · GitHub adds the old mode back in. This can be enabled through disableCursor = true
in configure {}
Thanks for getting this out so fast
Would it be possible to also have this as a property of Application so that it can be toggled during runtime?
You can now set hideCursor
and cursorHideMode
in the configuration and at run-time. disableCursor
has been removed to make way for an api that is compatible with the old one.
This is a really good solution, thanks for doing this.