Announcement

Collapse
No announcement yet.

Wormhole Shader Effect. How we can handle multiple wormholes?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Wormhole Shader Effect. How we can handle multiple wormholes?

    Hi guys

    Here's the effect: https://deepspacebanana.github.io/bl...-Shader-Effect
    By default these effect only can handle 1 wormhole at once, cause we set actorlocation in one blueprint and set 1 vector parameter in material parameter collection.

    The problem will appear when we would like to have 2 or more wormhole effects at once. How we can handle this? Set multiple vector parameters from different BPs? But how we when handle all that collection parameters inputs in material?

    Maybe there's some trick or workaround for this?


    #2
    Do you need to use a collection parameter? Why not just instantiate a new dynamic instance of that material and use a regular parameter?
    Latest Company Showreel
    https://vimeo.com/outpostvfx/spring17

    Comment


      #3
      Originally posted by Crow87 View Post
      Do you need to use a collection parameter? Why not just instantiate a new dynamic instance of that material and use a regular parameter?
      If we have multiple different object on scene and want that effect affect all that objects, its no way to do it without parameter collection.

      Comment


        #4
        To have what you want you can't use the wormhole position in a material parameter collection. The approach works fine for a one wormhole. For more wormholes you will need to rebuild the idea from scratch to consider that. Something like this:

        - change the material function to receive a input parameter vector 4 which will have the wormhole position
        - at the material from the mesh you will have a vector 4 parameter that you will feed it into the material function above
        - you will need a blueprint actor (lets call it wormhole victim for now), which will have the following parameters:
        > mesh (ie. table),
        > material for the mesh (which will have the material function inside)
        > the material id number at the mesh
        > an array of wormhole blueprint instances
        - you will search which is the closest wormhole to the mesh, checking the distance of each item in the array, the closest win and its location will be feed to the material instance for the mesh
        - whenever a wormhole appear, it will look for all actor instances of wormhole victim and add itself into their wormhole blueprint instances

        Hope it is not confuse enough, you might need to read it 2 or 3 times, take your time.
        Nilson Lima
        Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
        Join us at Discord: https://discord.gg/uFFSEXY

        UE4 Marketplace: Cloudscape Seasons
        supporting: Community FREE Ocean plugin

        Comment


          #5
          Originally posted by NilsonLima View Post
          To have what you want you can't use the wormhole position in a material parameter collection. The approach works fine for a one wormhole. For more wormholes you will need to rebuild the idea from scratch to consider that. Something like this:

          - change the material function to receive a input parameter vector 4 which will have the wormhole position
          - at the material from the mesh you will have a vector 4 parameter that you will feed it into the material function above
          - you will need a blueprint actor (lets call it wormhole victim for now), which will have the following parameters:
          > mesh (ie. table),
          > material for the mesh (which will have the material function inside)
          > the material id number at the mesh
          > an array of wormhole blueprint instances
          - you will search which is the closest wormhole to the mesh, checking the distance of each item in the array, the closest win and its location will be feed to the material instance for the mesh
          - whenever a wormhole appear, it will look for all actor instances of wormhole victim and add itself into their wormhole blueprint instances

          Hope it is not confuse enough, you might need to read it 2 or 3 times, take your time.
          Actually thats not a solution. Our meshes will still react to only 1 wormhole (which will win in terms of distance to mesh). But im talking about simultaneous work. So if 2 wormholes are closed to some mesh, the mesh will be affected by both wormholes with some power depends on proximity.
          I see only 1 solution: we have multiple wormhole blueprint, where we will set multiple vector parameter in material parameter collection (MPC) for wormhole_1, wormhole_2, etc. and also we will have several MPC inputs in material with some duplication on shader logic.
          Defenitely not clear solution because of stupid duplications but looks like it only way to achieve desired effect.

          Comment


            #6
            Originally posted by Alexander.L View Post

            Actually thats not a solution. Our meshes will still react to only 1 wormhole (which will win in terms of distance to mesh). But im talking about simultaneous work. So if 2 wormholes are closed to some mesh, the mesh will be affected by both wormholes with some power depends on proximity.
            I see only 1 solution: we have multiple wormhole blueprint, where we will set multiple vector parameter in material parameter collection (MPC) for wormhole_1, wormhole_2, etc. and also we will have several MPC inputs in material with some duplication on shader logic.
            Defenitely not clear solution because of stupid duplications but looks like it only way to achieve desired effect.
            The logic I explained above will work and of course you will need some changes to deal with the proximity, but for more than one wormhole affect the mesh would mean to collapse part of the mesh at one direction and part at another direction and so forth depending on the number of wormholes, you might end with an artifact left on screen because there is a chance you will form triangles between three or more wormholes and it will be displayed.

            PS: well, you can make the mesh invisible after the full collapse, then no artifacts left
            Last edited by NilsonLima; 01-21-2019, 07:25 AM.
            Nilson Lima
            Technical Director @ Rigel Studios Ltda - twitter: @RigelStudios
            Join us at Discord: https://discord.gg/uFFSEXY

            UE4 Marketplace: Cloudscape Seasons
            supporting: Community FREE Ocean plugin

            Comment


              #7
              You need a list of wormholes. There's no support for arrays in parameter collections and no looping in material graph, so you need to go down into the custom node rabbit hole.

              Comment

              Working...
              X