User Tag List

Results 1 to 13 of 13

Thread: Decal on Particle Collision?

  1. #1
    0

    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. #2
    1
    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

  3. #3
    0
    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 Name:  0d9f609695.png
Views: 725
Size:  184.3 KB
    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

  4. #4
    0
    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.

  5. #5
    0
    Samaritan
    Join Date
    May 2014
    Posts
    86
    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.

  6. #6
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,922
    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

  7. #7
    0
    Samaritan
    Join Date
    May 2014
    Posts
    86
    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.

  8. #8
    0
    Unreal Engine Developer
    Join Date
    Apr 2014
    Posts
    1,922
    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

  9. #9
    0
    Quote 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?

  10. #10
    0
    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 at 05:39 AM.

  11. #11
    0
    Quote 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.

  12. #12
    0
    Samaritan
    Join Date
    Dec 2014
    Posts
    97
    Quote 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?

  13. #13
    0
    Quote 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/marketplace/particle-editor-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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •