VL.Addons

Warning: Ramblings ahead.

What & Why?

Currently only a small collection of addons that have accumulated on my HD over the last ~2-3 years.
A lot of them developed during various projects. Some posted by others in the chat or in the forum.

Initially it was only to be a way to get those things more organized for myself (up to now I’ve just kept some files that I manually copied from project to project). But while tidying things up I thought it might become more like the beta addonpack.

Contributions by the vvvv community that:

  • don’t get added to the core libraries for reasons
  • don’t (yet?) merit their own nuget packages
  • get lost in the chat or forum otherwise

Ideally hosted by the vvvv group with some “external” maintainers that can merge pull requests (or maybe an organization like KairosResearchLab?).

Looking at the TextureFX stuff by @lecloneur for example you’ll see that making contributions to “official” libs can take a long time. One of the reasons being that the devvvvs only have limited resources. Maybe having something cared for by the community could move a bit faster (!= compromising on quality) and thus encourage more contributions?

Current structure

📦VL.Addons
 ┣ 📂.github
 ┃ ┗ 📂workflows
 ┃ ┃ ┗ 📜main.yml
 ┣ 📂deployment
 ┃ ┗ 📜VL.Addons.nuspec
 ┣ 📂help
 ┃ ┣ 📜Explanation Overview of available HitTest Nodes.vl
 ┃ ┣ 📜Explanation Overview of available Pixel Transform Nodes.vl
 ┃ ┣ 📜Explanation Overview of available TextureArray Nodes.vl
 ┃ ┣ 📜HowTo Animate a Camera.vl
 ┃ ┣ 📜HowTo Correct for Screen Bezels.vl
 ┃ ┣ 📜HowTo Different Color or Material Properties per Instance (Modulo).vl
 ┃ ┣ 📜HowTo Play a Spritesheet.vl
 ┃ ┣ 📜HowTo Render Text with Background.vl
 ┃ ┣ 📜HowTo Sample a TextureArray per Instance.vl
 ┃ ┣ 📜HowTo Sample a TextureArray with Index per Instance.vl
 ┃ ┣ 📜HowTo Texture Tansform Instanced.vl
 ┃ ┣ 📜HowTo Use GetSlice(TextureArray).vl
 ┃ ┣ 📜HowTo Use SetSlice(TextureArray).vl
 ┃ ┣ 📜Reference Cross.vl
 ┃ ┣ 📜Reference Disperse.vl
 ┃ ┣ 📜Reference Line (Dashed).vl
 ┃ ┣ 📜Reference MultiFlipFlop (Spectral).vl
 ┃ ┣ 📜Reference OrderedDictionary.vl
 ┃ ┣ 📜Reference QuadRenderer (TextureTransform).vl
 ┃ ┣ 📜Reference Segment (Advanced).vl
 ┃ ┣ 📜Reference Steps.vl
 ┃ ┣ 📜Reference TextureSize.vl
 ┃ ┣ 📜Reference WireBox.vl
 ┃ ┗ 📜Reference Zip (Advanced) nodes.vl
 ┣ 📂lib
 ┃ ┗ 📂net6.0
 ┃ ┃ ┣ 📜OrderedDictionary.dll
 ┃ ┃ ┗ 📜Zip.dll
 ┣ 📂resources
 ┃ ┣ 📂textures
 ┃ ┃ ┣ 📜001.dds
 ┃ ┃ ┣ 📜002.dds
 ┃ ┃ ┣ 📜003.dds
 ┃ ┃ ┗ 📜004.dds
 ┃ ┣ 📜CameraAnimation.xml
 ┃ ┗ 📜SpriteSheet.png
 ┣ 📂src
 ┃ ┣ 📂OrderedDictionary
 ┃ ┃ ┣ 📜A Generic OrderedDictionary in C# - CodeProject.URL
 ┃ ┃ ┣ 📜Key.snk
 ┃ ┃ ┣ 📜License-CPOL.htm
 ┃ ┃ ┣ 📜OrderedDictionary.Collection.cs
 ┃ ┃ ┣ 📜OrderedDictionary.cs
 ┃ ┃ ┣ 📜OrderedDictionary.csproj
 ┃ ┃ ┣ 📜OrderedDictionary.Dictionary.cs
 ┃ ┃ ┣ 📜OrderedDictionary.Enumerable.cs
 ┃ ┃ ┣ 📜OrderedDictionary.KeysCollection.cs
 ┃ ┃ ┣ 📜OrderedDictionary.List.cs
 ┃ ┃ ┣ 📜OrderedDictionary.ValuesCollection.cs
 ┃ ┃ ┗ 📜OrderedDictionary.xml
 ┃ ┣ 📂Zip
 ┃ ┃ ┣ 📜Zip.cs
 ┃ ┃ ┗ 📜Zip.csproj
 ┃ ┗ 📜VL.Addons.sln
 ┣ 📂vl
 ┃ ┣ 📂shaders
 ┃ ┃ ┣ 📜ArrayTextureInstanced_DrawFX.sdsl
 ┃ ┃ ┣ 📜Constant_TextureTransform_DrawFX.sdsl
 ┃ ┃ ┣ 📜ModuloGPU_ShaderFX.sdsl
 ┃ ┃ ┣ 📜SampleTextureArrayVector4.sdsl
 ┃ ┃ ┗ 📜SampleTextureArrayVector4WithIndex.sdsl
 ┃ ┣ 📜VL.Addons.2D.vl
 ┃ ┣ 📜VL.Addons.Animation.vl
 ┃ ┣ 📜VL.Addons.Collections.vl
 ┃ ┣ 📜VL.Addons.Control.vl
 ┃ ┣ 📜VL.Addons.Skia.vl
 ┃ ┗ 📜VL.Addons.Stride.vl
 ┣ 📜.gitignore
 ┣ 📜LICENSE
 ┣ 📜README.md
 ┗ 📜VL.Addons.vl

📜VL.Addons.vl

A meta file referencing and forwarding every file in the 📂vl folder, not containing any definitions itself.

📂vl

Contains files for the main vl categories/ libraries. If those become too unwieldy they could be split more granular. Also contains 📂shaders since it needs to be parallel to the stride definitions inside 📜VL.Addons.Stride.

📂src

Contains a visual studio solution referencing the different helper csproj. One project per “contribution” each project in a separate folder. The projects currently target .net6, so the whole thing only works with 5.0.

How to use it

Some ways I came up with:

Super Basic

Download the zipped files from github and either reference VL.Addons.vl to get everything all at once or one / more single files to get their respective functionality.

Nuget

Use it as any other library that comes as nuget. For information on how to use nugets with VL, see Managing Nugets in the VL documentation. As described there you go to the commandline and then type:

nuget install VL.Addons

Then reference it using the Dependencies menu .
image

or the Node Browser
image

This will give you access to everything contained in 📦VL.Addons which might or might not be what you want. Why have something Stride related referenced when only working with Skia for example.

When using Git

Add 📦VL.Addons as submodule to your repo (see [1] / [2] for an explanation).
Either directly use the “original repo” - will be read only - or make a fork if you want to make changes to the addons while working on your project. (Forking is a good idea anyways if you want to contribute).

After adding the submodule you either use it like described under Super Basic above or start vvvv with a commandline argument like:
vvvv.exe --package-repositories "d:\somepath\foo\"
Where 📂foo contains 📂VL.Addons.

Then use it as you would any other Nuget .

What’s included

Maybe I’ll add a comprehensive list later…
Just some things that I didn’t develop myself:
There is a nice camera animation workflow by @antokhio that he posted in the chat once ( I only made some minor changes). And @readme made some camera and animation stuff while we were patching “the show” for Node20.

Issues / Qs

Just off the top of my head:

  • I didn’t ask @antokhio or @readme for permission
    • Get in touch and I’ll remove your stuff
  • How to deal with licensing/attribution in general?
    • Ideally everybody contributing can agree on one permissive license like MIT or CC0.
    • What about external code? The ordered dictionary for example uses code licensed under CPOL.
      • Is it enough to mention / link to the license in a help patch?
      • Do the licenses have to be distributed with the nuget?
      • Do contributions that come with different lincenses have to be split into different files?
      • Do people have to consent to the licenses when installing the nuget?

What do you think?

21 Likes

That looks super tasty :-)

Nice initiative, thanks so much !

1 Like

Hey @bjoern!

Great to see this happening, thanks for the effort in kicking this off!

I want to give you a short heads-up that we are working towards one public repository that hosts the sources for several packages (VL.CoreLib, VL.Skia, VL.Stride, VL.ImGui, …), which should make it easier to work on collaborative tasks together with the community. But this public repository will need to focus on the central bits and pieces and will probably still be on the slow end of the pull-request-acceptance spectrum…

So that’s why this VL.Addon thing makes perfect sense.
One thing we advised the Kairos team to do is to have one repository that manages several packages. We internally learned it the hard way that for certain connected/depending packages, it does make sense to version them in one repository. I am wondering if this could mean that in the case of VL.Addons you maybe also should already make space for the possibility to put packages in there. Not totally sure though which strategy is best here. Just wanted to let you know of this learning process.

Hosting could be done by vvvv if you’d like us to do this. However, maintaining pull requests (…) should of course be in the hands of the VL.Addons team.

Anyway, great to see this repository which sounds like a place where everyone can contribute more easily and make the vvvvorld a better place!
Thanks again

1 Like

Super cool, thanks björn.

Not sure what I did back then that could be considered useful, but whatever it was, please go ahead - of course!

4 Likes

just checked out the addonpack today. wow…so much essential stuff in there. hittest, blendmodes, quadrenderer… i made all of this myself for a recent project, i should have looked into the pack first. damn…

great work

1 Like

Those I just added after you posted them in the chat. I didn’t really test them btw. just compared them to the beta helpatches. @tonfilm said in the chat that they don’t look quite correct to him…

mmm, i made a direct comparison, looked the same

Ok I’ll take your word for it :)

i found the original settings here FeralTic/DX11BlendStates.cs at 0ff90991f75b21894971cbf4216fa1540dc0ff5e · mrvux/FeralTic · GitHub

2 Likes

hej bjoern, Having a sprite sheet player(vec2) for working in skia would be nice! To avoid generating and decomposing all those matrices. Props for the add-on package!

Especially texture arrays

If you can up with a way that doesn’t impact performance too much, feel free to make a pull request ;)

Suddenly discovered that many of the shaders from this addon have explicitly defined samplers with no way to change them. Perhaps it’s worth reconsidering?

A lot of the shaders only “show the desired effect” when using a specific sampler, e.g. repeat.
So first of all you would need to make sure that the shader you are trying to change still “works” when using a different sampler. Ideally this needs to be done for all ~200 of them :)

Additionally every shader in VL.Addons is (manually) wrapped in a class that implements a certain interface. Currently the interfaces don’t have a specific method for exposing the samplers. There is a general method called SetParameters that is not part of the interface and specific for every class. One could use that to add (optional) sampler inputs. Or the interface needs to be extended by a dedicated SetSamplers method. But for that every node/wrapper needs to be manually updated and in those cases where changing the sampler isn’t advisable those inputs should be left unconnected and wouldn’t do anything.

TBH I don’t see myself tackling this in the near or even more distant future (at least not in my spare time). If you or someone else is up for it please create an issue / pull request on github.

2 Likes

@bjoern Now I realize that’s a lot of work, thank you. I guess it’s a bit of a legacy now. I’ll just keep in mind that next time it’s easier to do some shader tweaking by hands

You only need the ones that use textures that are not 1:1 sampled. so each one that modifies the UV coordinates before sampling, is important. so I think it wouldn’t be a crazy amount of effects. and they could be done one by one. @yar you can start with the one you needed and make a PR…

1 Like

What I meant is one has to go through all of them and check.

1 Like

I still haven’t gotten to the point where I can normally do PR on Github and suggest improvements. But I’ll leave one suggestion here:

image

Please make the GetVelocityMap output public. In some cases it is a very interesting texture that can be applied further.

One of my primary nuggets to install!
I have a problem, thou… I’ve reinstalled my computer and lost the folder. How can I install the pack corresponding to Gamma 5.2? I’ve tried using the commandline but a lots of things are broken since the pack is for 5.3


install VL.Addons -version 0.1.4
1 Like

thanks!