Jump to: Board index » General » Fusion

relax / avoid particles

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message
Offline

Rick van den Berg

  • Posts: 1352
  • Joined: Tue Jun 02, 2015 7:47 am

relax / avoid particles

PostWed Dec 06, 2023 2:06 pm

Is there a way to make particles "avoid" eachother? i'm trying to spawn like 50 company logo's, make them wiggle a bit with some turbulence, without them overlapping. In houdini there is an option called "point relax", which does that exact thing. I understand i'm working with bitmaps, with transparency, so that would be a bit harder to detect for any kind of software i guess..
Offline
User avatar

Bryan Ray

  • Posts: 2471
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: relax / avoid particles

PostWed Dec 06, 2023 4:22 pm

If I remember right, pFlock can cause particles to repel one another
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Rick van den Berg

  • Posts: 1352
  • Joined: Tue Jun 02, 2015 7:47 am

Re: relax / avoid particles

PostThu Dec 07, 2023 2:23 pm

ah, looks like that's doing something, little hard to find the settings that work for me, but thanks!
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 1:12 pm

Another option is to use a pCustom instead of a pTurbulence. You can then use an animated FastNoise as an image input to offset the x & y positions. Advantage is that you can then ensure it will never overlap (by restricting the offset). I'm not behind my Fusion computer right now, but can put a quick example together later if you want.
www.ablackbirdcalledsue.com
Offline
User avatar

Bryan Ray

  • Posts: 2471
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: relax / avoid particles

PostFri Dec 08, 2023 4:28 pm

You always say pCustom! :lol:
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Sander de Regt

  • Posts: 3449
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 4:50 pm

I was thinking the exact same thing.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 5:24 pm

I think it's time to admit I've got a problem! ;)
www.ablackbirdcalledsue.com
Offline

bentheanimator

  • Posts: 415
  • Joined: Mon May 13, 2019 10:38 pm
  • Location: Minneapolis, MN
  • Real Name: Ben Hall

Re: relax / avoid particles

PostFri Dec 08, 2023 6:15 pm

An example of that would be sweet. Does a turbulence field work in X,Y,Z? Would you use the same image for Z or plug in a second noise?
Resolve & Fusion Studio 18.6.4
Windows 10
Intel Xeon CPU 2699A @ 2.40GHz | 128GB RAM | 2xRTX3090 | 512NVME System | 8TB NMVE Scratch | 80TB 8Gbps Fiber

MacOS 12.7.2
MacBook Pro 13,3 | 16GB | Radeon 460 4GB | 256GB System | 256GB Scratch
Offline

Sander de Regt

  • Posts: 3449
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 6:50 pm

Okke Verbart wrote:I think it's time to admit I've got a problem! ;)

As long as you solve other people's problems with your problem I don't think it's a problem.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Sander de Regt

  • Posts: 3449
  • Joined: Thu Nov 13, 2014 10:09 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 6:50 pm

Okke Verbart wrote:I think it's time to admit I've got a problem! ;)

As long as you solve other people's problems with your problem I don't think it's a problem.
Sander de Regt

ShadowMaker SdR
The Netherlands
Offline

Rick van den Berg

  • Posts: 1352
  • Joined: Tue Jun 02, 2015 7:47 am

Re: relax / avoid particles

PostFri Dec 08, 2023 7:06 pm

hmm, interesting. gonna give that pcustom method a try soon. for now (a bit of time pressure) i decided to approach it the old fashion way in 2d, i copy-pasted dve's with a shake modifier on rotation, position, etc, to all the logo files. A bit of a different style but it did the trick :)
Offline
User avatar

Bryan Ray

  • Posts: 2471
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: relax / avoid particles

PostFri Dec 08, 2023 8:33 pm

Okke Verbart wrote:I think it's time to admit I've got a problem! ;)


This is the point where I should probably confess that I'm considering writing a Vertex Animation Textures macro built on CustomVertex3D.
Bryan Ray
http://www.bryanray.name
http://www.sidefx.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 8:44 pm

Quick example....just working on x and y (but z could be added too):

Code: Select all
{
   Tools = ordered() {
      FastNoise2 = FastNoise {
         Inputs = {
            Width = Input { Value = 2560, },
            Height = Input { Value = 1440, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Contrast = Input { Value = 3.16, },
            Brightness = Input { Value = -0.3, },
            XScale = Input { Value = 16.22, },
         },
         ViewInfo = OperatorInfo { Pos = { 134.667, 57.0606 } },
      },
      Text1 = TextPlus {
         Inputs = {
            Width = Input { Value = 256, },
            Height = Input { Value = 144, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            LayoutRotation = Input { Value = 1, },
            Red = Input { Value = 0.512, },
            Alpha = Input { Value = 1, },
            TransformRotation = Input { Value = 1, },
            Softness1 = Input { Value = 1, },
            StyledText = Input { Value = "PLACEHOLDER", },
            Font = Input { Value = "Open Sans", },
            Style = Input { Value = "Bold", },
            VerticalJustificationNew = Input { Value = 3, },
            HorizontalJustificationNew = Input { Value = 3, },
         },
         ViewInfo = OperatorInfo { Pos = { 270, 28.5758 } },
      },
      Background1 = Background {
         Inputs = {
            Width = Input { Value = 1920, },
            Height = Input { Value = 1080, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            TopLeftRed = Input { Value = 1, },
            TopLeftGreen = Input { Value = 1, },
            TopLeftBlue = Input { Value = 1, },
         },
         ViewInfo = OperatorInfo { Pos = { 134.667, 161.576 } },
      },
      pImageEmitter1 = pImageEmitter {
         ID = 1,
         Inputs = {
            XDensity = Input { Value = 0.005, },
            YDensity = Input { Value = 0.005, },
            AlphaThreshold = Input { Value = 0.173, },
            Lifespan = Input { Value = 1000, },
            Input = Input {
               SourceOp = "Background1",
               Source = "Output",
            },
            Style = Input { Value = FuID { "ParticleStyleBitmap" }, },
            ["ParticleStyleBitmap.Animate"] = Input { Value = 2, },
            ["ParticleStyleBitmap.DropToolsHere"] = Input {
               SourceOp = "Text1",
               Source = "Output",
            },
            ["ParticleStyle.SizeControls"] = Input { Value = 1, },
            ["ParticleStyle.Size"] = Input { Value = 0.063, },
            ["ParticleStyle.SizeOverLife"] = Input {
               SourceOp = "pImageEmitter1SizeOverLife",
               Source = "Value",
            },
            ["ParticleStyle.BlurOverLife"] = Input {
               SourceOp = "pImageEmitter1BlurOverLife2D",
               Source = "Value",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 270.667, 163.121 } },
      },
      pImageEmitter1SizeOverLife = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         CtrlWZoom = false,
      },
      pImageEmitter1BlurOverLife2D = LUTBezier {
         KeyColorSplines = {
            [0] = {
               [0] = { 0.5, RH = { 0.3, 0.5 }, Flags = { Linear = true } },
               [1] = { 0.5, LH = { 0.7, 0.5 }, Flags = { Linear = true } }
            }
         },
         SplineColor = { Red = 192, Green = 128, Blue = 64 },
         CtrlWZoom = false,
      },
      pCustom1 = pCustom {
         ID = 4,
         CtrlWZoom = false,
         Inputs = {
            NumberIn1 = Input { Value = 0.08, },
            Intermediate1 = Input { Value = "getr1w(pxi1+0.5,pyi1+0.5)", },
            Intermediate2 = Input { Value = "getr1w(pxi1,pyi1)", },
            PositionXExpression = Input { Value = "if(age==0,px,mass+(i1*n1))", },
            PositionYExpression = Input { Value = "if(age==0,py,user+(i2*n1))", },
            RedExpression = Input { Value = "1", },
            GreenExpression = Input { Value = "1", },
            BlueExpression = Input { Value = "1", },
            AlphaExpression = Input { Value = "1", },
            MassExpression = Input { Value = "if(age==0,px,mass)", },
            UserExpression = Input { Value = "if(age==0,py,user)", },
            Input = Input {
               SourceOp = "pImageEmitter1",
               Source = "Output",
            },
            Image1 = Input {
               SourceOp = "FastNoise1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 380.667, 163.121 } },
      },
      pRender1 = pRender {
         Inputs = {
            _MotionBlurWarning = Input { Disabled = true, },
            Width = Input { Value = 2560, },
            Height = Input { Value = 1440, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            ["MaterialID.MaterialID"] = Input { Value = 1, },
            ["ObjectID.ObjectID"] = Input { Value = 1, },
            Input = Input {
               SourceOp = "pCustom1",
               Source = "Output",
            },
         },
         ViewInfo = OperatorInfo { Pos = { 490.667, 163.121 } },
      },
      FastNoise1 = FastNoise {
         Inputs = {
            Width = Input { Value = 2560, },
            Height = Input { Value = 1440, },
            ["Gamut.SLogVersion"] = Input { Value = FuID { "SLog2" }, },
            Contrast = Input { Value = 0.59, },
            XScale = Input { Value = 11.34, },
            SeetheRate = Input { Value = 0.087, },
         },
         ViewInfo = OperatorInfo { Pos = { 487.333, 94.6364 } },
      }
   }
}



Few things happening in here:

- PimageEmitter creates the initial particle positions (like a grid)
- pCustom saves the initial position ("if(age==0, ") for x (in Mass) and y (in User).
- pCustom reads the Fastnoise in i1 and i2 (same image, just offsetting it to get a different value for x and y)
- Px and Py are at their base values at age=0 and then governed by Mass and User plus the offset (i1 and i2 respectively).

Hope it sorta makes sense!
www.ablackbirdcalledsue.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 8:45 pm

Bryan Ray wrote:
Okke Verbart wrote:I think it's time to admit I've got a problem! ;)


This is the point where I should probably confess that I'm considering writing a Vertex Animation Textures macro built on CustomVertex3D.


Oh, that sounds very interesting!! Please do so!
www.ablackbirdcalledsue.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 8:47 pm

Rick van den Berg wrote:hmm, interesting. gonna give that pcustom method a try soon. for now (a bit of time pressure) i decided to approach it the old fashion way in 2d, i copy-pasted dve's with a shake modifier on rotation, position, etc, to all the logo files. A bit of a different style but it did the trick :)


Hey..if it works it works! To be honest, I often resort to 2D as well if I can get away with it :-)
www.ablackbirdcalledsue.com
Offline

Okke Verbart

  • Posts: 290
  • Joined: Tue Jan 17, 2017 8:40 pm

Re: relax / avoid particles

PostFri Dec 08, 2023 8:49 pm

bentheanimator wrote:An example of that would be sweet. Does a turbulence field work in X,Y,Z? Would you use the same image for Z or plug in a second noise?


the pTurbulence can indeed affect all 3 and you could mimic the same in the pCustom. You could get away with 1 FastNoise and just read the x,y and z at different offsets. Better would be indeed to use different FastNoises, one for each axis.
www.ablackbirdcalledsue.com

Return to Fusion

Who is online

Users browsing this forum: No registered users and 13 guests