Announcement

Collapse
No announcement yet.

Don't understand the sample file "paints.max"

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

  • Don't understand the sample file "paints.max"

    Hi!

    I tried to get two different coloured liquids in my scene, but I just don't understand the way it is done.

    You do this in your sample scene "paints.max", but I am not able to reconstruct this scene.

    Where is the setting for the different material per liquid?

    Greetings and thanks!

    Den

  • #2
    the basic idea is to attach a color to the liquid, using the UVW channel of the simulator. the simplest way to do this is to put texture in the uvw slot of the sources. however, if you do this, the colors of the paints will be mixed with black component, because this is a grid simulator and the air is also simulated and has its own uvw value, that is black bu default. so, we just initialize the entire grid with two colors (using the script), blue and red, and start the simulation. now the air has the same color and there is no black interference. in few words, it's a fake, not actually different liquids.
    the rendering itself is based on the phoenix texture, it exports the uvw channel and we can use it to construct a material.
    ______________________________________________
    VRScans developer

    Comment


    • #3
      hmm, what is this script you are speaking of? i am using 2.0 and wanted to learn by introducing a third color liquid, but do not see the connection between the shader object, the phoenixFDtexmap and emitters, could you explain a little further? or does someone know a tutorial i could follow?

      Comment


      • #4
        the script is visible when you press the "edit" button right to the "use script" option in the simulation panel.
        so, here is a workflow in few lines, without scripting:
        - create a simulator and load the liquid preset
        - create a source (the barrel) and set temperature=1. this is the liquid source. set in the material ID 1, to enable only the cap to release liquid
        - create 2,3,4 or more cylinders and put them in the liquid source.
        until now if you press simulation you will have just 3 cylinders producing liquid
        now we have to organize colored uvw channel for each source
        - enable the uvw export, we will use the uvw channel to color the liquid
        - create one enveloping box per cylinder, and put them all in the exclude list. make the boxes not just to cover the cylinders, but to be bigger as possible. the boxes have to be bigger to avoid the uvw dissipation near to the liquid surface.
        - create one source barrel per cylinder, the best way is to make one, and then copy it after the setup
        - select the boxes in the corresponding source barrel
        - setup the boxes sources as follow: animate the discharge from 1000 to 0 in four frames, select brush mode, deselect all the channels except uvw, put a VRay color texure in the uvw map. the texture gives the color of the corresponding source
        until now, you have the colored simulation, but the rendering is still simple diffuse
        - create new dummy phoenix simulator (do not overlap it with the original one!), this simulator is just the uvw exporter, we cant use the original one because the circular references
        - copy the name of the real simulator and paste it in the input path, after the $(simoutput), by default it will look like $(simoutput) PhoenixFD01
        - create your liquid material and put a PhoenixFD Texmap in the color slot.
        - put the dummy simulator in the source slot of the texture
        - select UVW channel for the texture
        - apply the material over the original simulator
        this is all, simulate and render.
        i'm attaching the scene that i just made following the tutorial, just for sure, if there is something skipped.
        Attached Files
        ______________________________________________
        VRScans developer

        Comment


        • #5
          excellent ivaylo! thanks for the great explanation and the demo scene, it works nicely and i understand a lot better now.

          how do i get color on the sides? see attached image (the yellow color has an overlapping box primitive)
          Attached Files
          Last edited by kimgar; 07-05-2013, 07:09 AM.

          Comment


          • #6
            try to change the tilling mode of the phoenix texture to mirror. single mode means that outside the box the color is black
            btw seems like your liquid setup is wrong, vorticity not zero? or liquid source with temperature above 1?
            Last edited by Ivaylo Katev; 07-05-2013, 07:32 AM.
            ______________________________________________
            VRScans developer

            Comment


            • #7
              yes, i haven't tweaked the liquids yet, just wanted to see if i could do a color mix. reducing vorticity did calm it alot, and the mirror setting fixed the weird colors, thanks!
              i'm not sure if it matters, but i am not using temperature channel (for some reason i could not get this to work), i'm using fuel = 1, is there a difference?

              the surface mixes nicely now, but i'm still having trouble with the sides, i've tried adjusting the envelopes but i'm not sure what what's best, as big as possible but not overlapping?
              what's the trick behind the setup shown here? http://www.youtube.com/watch?v=6k9YL98TT7U

              this is what i get so far:
              Attached Files

              Comment


              • #8
                try to use UVW bias=1 (the parameter just above the colors and transparency button). or just cut off the walls with a gizmo
                about the fuel - no problem to use it. but keep in mind that in the next release it will be not supported
                ______________________________________________
                VRScans developer

                Comment


                • #9
                  ah, beautiful, thanks ivaylo. the bias did not do anything but the gizmo did the trick, thanks!

                  Comment


                  • #10
                    hmm, i tried to add wind and squeeze this into a tube, things seem ok until the wind kicks in, it actually seems to blow the colors away!

                    there's a short vido here : http://www.kimgar.com/files/phxtestmix.mp4

                    any ideas what could be causing this? or am i way off and should try another approach?
                    Attached Files

                    Comment


                    • #11
                      as i said the UVW method is limited by its nature, i think this situation can't be handled.
                      ______________________________________________
                      VRScans developer

                      Comment


                      • #12
                        yes, that's what i realized too, hmm, is it possible to hook up serveral simulator grids inside each other? each with its own fluid?
                        mixing different viscosities as well as colors would be an awesome thing!

                        Comment


                        • #13
                          i suggest to use general purpose particles (called simple drag in the source combo) make each source to produce particles and then use the particle texture to convert them into texture and to color the water with it.
                          ______________________________________________
                          VRScans developer

                          Comment

                          Working...
                          X