First part of a 90 minutes tutorial about how to simulate a realistic Sun in Houdini software.  It covers topics like : vex coding, vector calculus, VDB volumes, particle simulation , magnetic field and much more. I hope you'll enjoy watching this as much as i enjoyed doing it. Second part coming soon

If you have any questions about this setup, write me at

Thank you and enjoy!


  • harryabreu 1 year ago  | 

    Thank you very much ;-)

  • rovewar 1 year ago  | 

    Very nice tutorial!

    When I add the popgrains and start the simulation, the points start to slowly move away from the sun's surface. I added the popgrains without changing any of it's default settings. If I bypass the popgrains they again stick to the surface. Any idea what's up with that?

    • Bogdan Lazar 1 year ago  | 

      Could be many causes.
      Did you create an pscale attribute? If yes , try lower it. My guess is that when you activate grains, they collide to closely. or they are too many . So try to lower the pscale radius. Hope it helps

  • DevinHoudini 1 year ago  | 

    How is this for beginners?

    • Bogdan Lazar 1 year ago  | 

      I had a lot of comments from friends that is not so hard what i do here. So i decided to call it "Begginer"tut. :)

  • hitch2 12 months ago  | 

    thanks for great tut indeed
    i wanted to do some rendering test
    i just having some issues on rendering the mantra cant fir geometry obj/Magentic_field/merge2

    • i_HiTcH 11 months, 2 weeks ago  | 

      nice i fix that thing...

      cant wait for part 2

  • teak421 11 months, 3 weeks ago  | 

    Outstanding tutorial... When are you planning on releasing part 2? Thanks!

  • ASAHEL ABISAI MARTINEZ 11 months, 3 weeks ago  | 

    I have some error when I put the code in the wrangle node, its this correct ?

    //open a point cloud for all points in Input 2 where (our pole points are connected)

    int handle = pcopen(@OpIput2, "P", v@P, 10.0, 50);

    //initalise a vector (magVecField) with no values

    vector magVecField = set(0.0,0.0,0.0);

    // "iterate" with "while" loop through all the retrieved points ( pts) using "pciterate" VEX function

    while (pciterate(handle))


    // define cariables to work with - float (pole) for magnetic charge and vect (pts) for points position

    float pole;
    vector pts;

    // import the (pole) value from the points in input 2

    pcimport( handle, "pole", pole);

    // import position of the points (pts)

    pcimport(handle, "P", pts);

    // calculate the vector (dist) between (pts) and voxel position (v@P)

    vector dist = v@P - pts;

    // calculate magnitude (mag) of vector (dist)

    float mag = length(dist);

    // calculate normalise distance (ndist)

    vector ndist = normalize(dist);

    // find magVecField by multypling pole with ndist and with invers of the squared dist *NEW

    magVectField += pole*ndist*(1.0/(mag*mag));


    // set our magneticfield inside voxel (v@P) to magVecField

    v@magneticfield = magVecField;

    • DosedMartian 6 months ago  | 

      It seems you're missing an "n" when defining "handle".

      This code worked for me(no comments though):

      int handle = pcopen(@0pInput2, "P", v@P, 100.0, 100);

      vector magVecField = set(0.0, 0.0, 0.0);

      while (pciterate(handle))

      float pole;
      vector pts;

      pcimport( handle, "pole", pole);

      pcimport(handle, "P", pts);

      vector dist = v@P - pts;

      float mag = length(dist);

      vector ndist = normalize(dist);

      magVecField += pole * ndist*(1.0/(mag*mag));


      v@magneticField = magVecField;

  • ragupasta 10 months ago  | 

    I agree that this is not a beginner tutorial.

    However: It is a very good tutorial. it has a lot of depth, it's well made and the theory really helps in understanding what is going on.

    Part 2 needs uploading, will be amazing to see this finished.

    Thank you.

  • Isaac_Peral 8 months, 2 weeks ago  | 

    Hi Bogdan,
    The entire planet wait for the second part of your sun.

    Thanks for your splendid contribution.

  • jerjozwik 8 months, 2 weeks ago  | 

    i just started houdini tutorials 2 days ago, this was a bit of a struggle for beginner but i was able to complete it and am seriously impressed by it. my mind was buzzing all night thinking of other applications for this!

  • Imconected 6 months, 3 weeks ago  | 

    Tutorial part 2 anytime soon ?

    Cheers !

  • Grigrory Sadovnikov 4 months, 3 weeks ago  | 

    i want watch 2nd part, very interesting tutorial! THX!!!

  • mrWolf 4 months, 2 weeks ago  | 

    I worked on something very similar a few years ago. But your tut looks a lot easier to understand. Well done !!

  • zhoukai 4 months, 1 week ago  | 


Please log in to leave a comment.