Announcement

Collapse
No announcement yet.

Decal on Particle Collision?

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

  • Decal on Particle Collision?

    Hi all
    this is my first post, I am working on a small student game and would like to know how I could spawn blood decals on particle collisions, I would really appreciate it if you guys could help me out with this or point me in the right direction.
    Cheers.
    Josh

  • #2
    The particle emitter in question has to have a collision module to detect collisions and then in blueprints you can pick up from the Collision event on that particle emitter and get the hit location of the collisions and then spawn decals

    Matt

    Comment


    • #3
      Thanks for the help Matt.
      I have added collision and the blood kills on collision, I have setup this in Blueprint if you don't mind having a look Click image for larger version

Name:	0d9f609695.png
Views:	1
Size:	184.3 KB
ID:	1113037
      no decal is spawning on collision. at this time i am still trying different methods and nodes, but like the idea that the community can help while searching for the answer.
      Cheers mate.
      Josh

      Comment


      • #4
        Sorry for not checking back with you, I don't come here frequently but I'm trying to more often now.

        First you need to approach the problem in the way that well best show you what is not working. Instead of spawning a decal at that location, try printing the location of the collisions. If they are coming back with the locations of where your blood is, then your decal isn't working or spawning in the right direction.

        By the looks of your code, you would not be able to see your decal because of it's rotation, because you're telling it to be perpendicular to the surface it is hitting. Try spawning objects to test, if they work adjust your rotation accordingly.

        Comment


        • #5
          It would be nice if we could have decals as particles, just as we can have meshes and point lights. Could also use to simulate fluids flowing across a surface.

          Comment


          • #6
            You actually can do that manually by using a projection type material. Try using the node "world position behind translucency". You can use this to make any particle seem like a decal. Then you could do a spheremask with the particle pixeldepth and scenedepth to only render the projection when the particle is close to an opaque object.
            Ryan Brucks
            Principal Technical Artist, Epic Games

            Comment


            • #7
              That still wouldn't give us the ability to change lighting characteristics like roughness and surface normal, since the deferred lighting is over by the time our projected translucent material is processed.

              Comment


              • #8
                Yes that is a great point. I will ask around next week to see if there is some way to actually do decal particles. I am not sure how difficult it would be.
                Ryan Brucks
                Principal Technical Artist, Epic Games

                Comment


                • #9
                  Originally posted by RyanB View Post
                  Yes that is a great point. I will ask around next week to see if there is some way to actually do decal particles. I am not sure how difficult it would be.
                  Any update on this?
                  -TorQueMoD
                  www.torquemod.com

                  Comment


                  • #10
                    I got this working actually. Firstly you don't need to create a Dynamic Material Instance. Secondly, use the Direction for the rotation not the Normal and Thirdly, make the XYZ values for the decal scale the same. This avoids stretching on different angles in your environment. If you want to stop the decals from overlaying on top of the player, just open your pawn, select it's mesh and uncheck "Receive Decals" in the details panel.

                    Last edited by TorQueMoD; 01-28-2017, 05:39 AM.
                    -TorQueMoD
                    www.torquemod.com

                    Comment


                    • #11
                      Originally posted by RyanB View Post
                      Yes that is a great point. I will ask around next week to see if there is some way to actually do decal particles. I am not sure how difficult it would be.
                      It requires some C++ to create a new particle editor module, but is actually pretty straightforward.
                      Here is what I came up with:



                      The biggest problems is how to set up the correct rotation, as decals are rather ugly when rotated the wrong way.
                      Particle Editor Extension: Marketplace Page | Documentation
                      Code plugin which extends your particle effect toolbox with new possibilities.


                      SVG Importer Plugin: Marketplace Page | Gumroad Page
                      Import SVG (scalable vector graphics) files as rasterized rendering or as multi-channel signed distance field.

                      Comment


                      • #12
                        Originally posted by Cultrarius View Post
                        It requires some C++ to create a new particle editor module, but is actually pretty straightforward.
                        Here is what I came up with:



                        The biggest problems is how to set up the correct rotation, as decals are rather ugly when rotated the wrong way.
                        Any chance you could share how you accomplished that?

                        Comment


                        • #13
                          Originally posted by Wrekk View Post
                          Any chance you could share how you accomplished that?
                          Well, you can just check out the particle plugin (75% off in the sale!): https://www.unrealengine.com/marketp...itor-extension

                          But the gist of it is this:
                          I created a new decal component (by subclassing UDecalComponent) which holds the particle module ID that created it.
                          I then created a new particle module (by subclassing UAbstractParticleModule) which when updating particles looks at the components attached to its parent to find all the custom decals. It then destroys excess components or creates new ones as necessary (new decal components are attached to the module's parent so they can be gathered again on the next update).

                          The custom decal holds the module ID to prevent different modules interfering with each others decals
                          Particle Editor Extension: Marketplace Page | Documentation
                          Code plugin which extends your particle effect toolbox with new possibilities.


                          SVG Importer Plugin: Marketplace Page | Gumroad Page
                          Import SVG (scalable vector graphics) files as rasterized rendering or as multi-channel signed distance field.

                          Comment

                          Working...
                          X