Add feature to annotate ComputeFloat4 as Color

…so one doesn’t necessarily need a ColorIn or ColorMap .

@tonfilm proposed in the chat to also try the Color attribute with ComputeFloat4, unfortunately this doesn’t work. The other suggestion was to use compose ComputeColor instead but this results in an IComputeNode input pin.

.

@lecloneur and me have been porting shaders to stride. In contrast to the standard effects we decided to make the Color inputs of type compute. This allows to do some stuff that otherwise isn’t possible. On the other hand the patching workflow can be “bumpy” when you only want to input a simple colors but always have to add a ColorIn.

So dear devvvvs could you please add this feature :) Or if it is possible for an external party to add it, point me in the right direction, so I can try and make a pull request?

Teaser:

8 Likes

Yes, the Color attribute would be the right one, so it works the same for float4 and ComputeFloat4.

But there might be some subtleties with color space conversion. The ColorIn node will convert from sRGB to linear. If you connect a shader, the color should be in linear space then.

What is generally the color space of these shaders? If you ported them from beta, they are probably written to work in gamma space…

the only reason these inputs are still Color and not compute is exactly the lack of better support for choosing colors. we talked about it when working on the shaders and came to the conclusion we’ll not have a quick solution for this so left those inputs non-compute for the time being. but agreed, this feature is desired.

While the TFX concept started in 2011 the oldest shader we found (using the wayback machine) and ported to VL is dated back to 2008, this library somehow represent 15 years of work done by more than 45 different vvvv contributors.

A little effort on your side would be greatly appreciated to make the TextureFX 3.0 community project a real game changer for VL.

Truly…

4 Likes

Just opened two PRs about this. The first one is non-breaking and should be safe to merge:

while the second one needs more feedback / testing and is not ready yet for merge:

4 Likes

That is a very good solution.

The only thing that would be great is assigning GPU<Vector4> outputs to GPU<RGBA> inputs (and the other way around) since they are the same in the shader. But I guess this won’t be possible because .NET doesn’t let you do that. So I’d add simple conversion nodes (ColToV4, V4ToCol) in both directions so that this would be possible in the patch if needed.

vvvv gamma 5.3 preview 405 now has the above PRs applied. this is a breaking change! fixing the issue is simple though. there are 2 options:

  • use a Convert (RGBAToVector4) node to convert from GPU<RGBA> to GPU<Vector4>
  • in the shader use ComputeColor instead of ComputeFloat4
2 Likes

Is there also Vector4ToRGBA?

yes

1 Like