Closed azeno closed 7 months ago
The fact that the types GPU<Vector4>
and GPU<RGBA>
aren't assignable still bugs me a little bit. How about adding something like an interface GPU<Vector4> : IGPUFloat4
and GPU<RGBA> : IGPUFloat4
somewhere in the type hierarchy? Didn't think it thru, just wanted to drop this thought here.
The goal would be that the inputs with the color intent would have this common supertype, and would accept GPU<Vector4>
and GPU<RGBA>
as input. The outputs can always be concrete types.
You can't really express this. You can only say GPU<T> : IGPUFloat4
but that makes no sense. My gut feeling tells me we need some conversion links here. One needs to be able to register converters and the system will apply them as a last resort on links, like it currently does for T and GPU<T>
.
As long as we don't have this we should think of a good node design to achieve this. How about a node called Convert
taking GPU<TIn>
and returning GPU<TOut>
? That way the story might be kept simple.
PR Details
Description
One can now either add the
[Color]
attribute to an existingComputeFloat4
pin, or use Stride's originalComputeColor
type. Both ways lead to the same result, the pin on vvvv side is of typeGPU<RGBA>
.The
[Default]
attribute is also supported. For example to set red as the default color, one would write[Default(1, 0, 0, 1)]
.Related Issue
https://discourse.vvvv.org/t/add-feature-to-annotate-computefloat4-as-color/21591/4
Types of changes
Checklist