VL.Addons

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!

Hey, spending some time with the TextureArrays in the Addons and have two questions, if you don’t mind.

  1. Is it also possible to sample TextureArrays as GPU(Float32) for a Displacement map?
  2. And could I somehow also apply TextureFX to these?

It should be, but for some reason it doesn’t work. As soon as an “instanced sample” is used as input for Displacement the material doesn’t compile. It works when using it for Metalness or Roughness on the Material directly or as input for Blend [Transparency] for example (see the Displacement patch for details).
So I guess this is a bug in VL.Stride or Stride. Idk if the devvvvs (@Elias ?) have time to look into it. If you need it for a commercial project maybe you can speed things up by requesting support.

You could use the existing TextureFX like this for example:

Other than that I think you’ll have to rewrite the shaders so they sample from the correct array slice. Made an example for ‘Bias’ (also attached).
There might be better ways to do this, maybe @tonfilm has an idea.

shader BiasTextureArrayFloat32_ShaderFX : ComputeFloat, ShaderBaseStream, Texturing
{
    cbuffer PerMaterial //when used in materials
    {
        stage uint ArrayTextureSize = 1;
        stage compose ComputeFloat Amount = 1;
    }

    rgroup PerMaterial //when used in materials
    {
        stage Texture2DArray ArrayTexture;
    }

    float bias(float x, float ctrl = 0.5)
    {
 	    return ctrl > 0 ?  (x / ((((1.0/ctrl) - 2.0)*(1.0 - x))+1.0)) :  1-(x / ((((1.0/abs(ctrl)) - 2.0)*(1.0 - x))+1.0));
    }

    override float Compute()
    {
        float3 uvz = float3(streams.TexCoord, streams.InstanceID % ArrayTextureSize);
       
        float4 color = ArrayTexture.Sample(LinearSampler, uvz);

        float amount = Amount.Compute();

        return bias(color.r, amount);
    }
};

Displacement Instanced and TextureFX.7z (1.3 MB)

1 Like