tyFlow for 3ds max – Basic Tutorial

Software:
3ds max 2019 | tyFlow

rocket_balls_new.gif

tyFlow is a new advanced event driven particle / dynamics system plugin for 3ds max that can somewhat be described as the “next generation of Particle Flow*“.
An ‘event driven particle system‘ is a particle system in which the behavior of the particles is defined in ‘events‘. each event contains a collection of ‘operators‘ that control the different aspects of the particle behavior, like their shape, their speed, direction etc. special ‘test operators‘ are used to check if the particles should switch to a different event and so change their behavior.
Setting up an event driven particle system in 3ds max is done through a node based visual interface, in which the nodes in the flow graph are the particle events, each event is a collection of operators and their parameters.

This tutorial demonstrates some fundamental concepts of event driven particles and tyFlow:

  1. Using Property Test operators to switch between different motions and shapes.
  2. Using the PhysX Shape and PhysX Switch operators to switch between physical and non-physical particle behavior.
  3. Spawning new particles and deleting them.

> Note that while understanding the logic of this example is relatively easy, tweaking all the parameters to get it right takes a lot of tests and fine tuning.
Download the example file and playing with the system parameters to get to know how the different operators affect the particles.

Download the tutorial example 3ds max file here

Untitled-1.jpg

Explanation of the flow graph:

> To create a tyFlow particle system:
In Command Panel > Create > Standard Primitives,
Click tyFlow, and then click and drag in the viewport to create a tyFlow object.
When the tyFlow object is selected, in the Modify panel press the Open Editor button to open the tyFlow editor. Drag operators from the library below to the work space in order to create a new event containing them, or drag them into existing events.

> Note that almost all of the system’s events contain a Display operator set to Geometry mode so that the particle’s actual animated shapes will be displayed in the viewport, and also a Mesh operator needed for particles to be exported to a render engine for final rendering.

  1. Particles are initially created in event: ‘Birth’ using a Birth Objects Operator, and are immediately sent to the next event: ‘Physical Falling’ by the Send Out operator.
    > The Birth Objects operator is used to initialize particles directly from scene objects.
    Untitled-4
    Initial setup of the spheres as sources of particles for the Birth Objects operator:Untitled-3
  2. The event titled ‘Physical Falling’ is the only event in the system in which the particles behave as PhysX objects who’s motion is governed by physical simulation i.e they fall and collide with the slide model (named Box001).
    The PhysX Shape operator turns the particles into physical simulation objects, and the PhysX Collision operator adds the slide model as a collision object to the simulation.
    A Property Test operator checks if the falling balls fell below -35 in the Z axis, and if so sends them to the event titled ‘Rocket Upward’.
    > Note that in the PhysX Collision operator, the Hull Type of the slide model is set to Mesh rather than Convex to allow the sphere particles to slide inside the slide (a convex hull type would behaves as if it’s filled making the balls fall to the sides)Untitled-5.jpg
    > Note that in the tyFlow PhysX settings, the default ground collider has been disabled to allow the balls to fall freely below the 0.0 Z axis position.Untitled-6
    > The (standard) Shape Operator and Speed operators are in this event in order to reset the shape and speed of particles in case they entered this event after already having different shapes ans speeds.
  3. The event titled ‘Rocket Upwards’ uses a PhysX Switch operator to deactivate the particles participation in physical simulation, assigns them a new (rocket shape),
    A Force operator referring to a tyWind object causes the particles to accelerate upwards, and a Spawn operator to have each original particle spawn new particles as the rocket trail.
    A Property Test operator checks if the particles have reach a height of 200 and if so sends them to the event titled ‘Chopper back to start’.
    > Note that the Slow, and Rotation operators are in this event to force the particles back to default orientation so the rockets will be aimed upwards.
    > The Spawn operator creates new particles and at the original particle location and sends them to the event titled ‘Rocket flare’.Untitled-8.jpg
    rocket_ball_switch
  4. The event titled ‘Chopper back to start’ assigns the particles a new ‘little chopper’ animated shape, and uses a Force operator to make them affected by the tyWind object pointing back to the start.
    > Note that the Shape operator has the Animated Geometry option checked, and set to sync by particle age. the animation speed is played back 3 times faster than the original animation.
    > A Property Test operator checks if the particles Y position higher than -150 and if so sends the particles to the event titled ‘find drop location’.untitled-9.jpg
  5. The event titled ‘find drop location’ uses a Find Target test operator to make the particles move to the Point Helper object located above the slide and when they have reached it send them back to the event titled ‘Physical falling’ where they start their journey all over again.
    > Note that the Slow operator slows the particles velocity that was inherited for the previous event so they wont overshoot and ‘fly’ further beyond the point helper.Untitled-10.jpg
  6. The event titled ‘Rocket flare’ defines the shape, speed and direction of the spawned rocket trail particles and uses a Time Test operator to check if the trail particles have existed more than 3 frames and if so send them to the event titles ‘Delete Flare’
    Untitled-11
  7. The event titles ‘Delete Flare’ uses a Delete operator to delete the trail particles.

System setup with the tyWind objects responsible for moving the particles in the non-physical events of the system, and a Point helper object that serves as a ‘find target’ for the particles to get back to the initial location above the slide:

Untitled-2

Particle shapes for the ‘Rocket Upward’, ‘Chopper back to start’ and ‘find drop location’ events.
Note that the shape pivots are consistently at the center of the ball for the shape switching to work well, and that the ‘chopper’ animation is done at the mesh level using Poly Select and XForm:

rocket_balls_shapes

* Particle Flow is a powerful event driven particle system that was originally developed by ThinkBox software, ans later bacame 3ds max’s built in particle system.

UE4 – Enable complex collision for models

Software:
Unreal Engine 4.21

By default UE4 uses fast simplified convex collision shapes to calculate collision for static mesh actors.
This means that the player or projectiles wont be able to path through holes, openings or doors in the model.

To set complex (concave) collision for a static mesh model:

In Static Mesh editing window, in the details pane, under Collision:
Set Collision Complexity to: Use Complex Collision As Simple

Static_Mesh_Complex_Collision.jpg

This example shows the default behavior for a model that has an opening, neither the projectiles nor the player can pass:

Simple_Collision.gif

In this example collision for the model was set to Use Complex Collision As Simple:

Complex_Collision.gif

 

Blender – Bake rigid body physics to Keyframes

Software:
Blender 2.82

  • I always forget this, try to do it through the regular animation baking option and get frustrated that it doesn’t work…

When you want to bake an object’s Rigid Body physics simulation to regular Keyframes:

  1. Select the wanted objects.
  2. Press F3 to open the command search floater,
    Begin typing: bake to keyframes to Locate the command:
    Rigid Body: Bake To Keyframes and select it.
    Note:
    The command will appear only if objects with rigid body physics properties are selected.
    Annotation 2020-05-17 154351
  3. Set a frame range for the bake and press OK:
    Annotation 2020-05-17 154413
  4. The physically simulated motion is recorded to keyframes:
  5. Annotation 2020-05-17 154458

 

Related:

  1. Bake NLA animation
  2. Cloth to shape keys

Understanding Fresnel Reflections

What we refer to in CG by the term “Fresnel Reflections” or “Fresnel Effect”, is the way Specular Reflection intensity changes according to light \ surface incident angle, and it is a basic optical property surfaces.

Specular reflection intensity changes according to light incident angle, and behaves almost like a perfect mirror at grazing view angle.
The reason we call this natural reflection behavior “Fresnel Effect” or “Fresnel Reflection” is that the equations describing the how reflection intensity changes according to incident angle were invented by the French Physicist Augustin-Jean Fresnel, and in early CG days, not all systems knew how to calculate natural reflections or reflections at all for that matter. So in CG we ended up treating this as something special, when in fact it’s not special in nature, it was just special in the early days of ray-tracing.

When rendering Fresnel Reflections, the reflection intensity isn’t determined by a linear blending percent like mixing a layer.
It’s determined by a factor called “Refractive Index” or “Index Of Refraction” i.e. IOR.
The IOR value is derived from the physical material’s density, which is the key factor determining both reflection intensity and refraction amount.

Examples of some physical IOR values*:
Air (vacuum): 1.0
Water: 1.33
Glass: 1.52
Diamond: 2.417
* Physical values differ between different measurements and samples of materials so you might see differences between different data sources.

FResnel_Off

This ball is rendered without “Fresnel Reflections”.
Its Specular reflection is blended consistently at 50% over the diffuse color (reflection), not affected by the light/view incident angle.
The result looks wrong for a natural material. It may look like a dielectric material (non metal) that’s coated with a silvery coating, but it can’t look correctly like glossy plastic or glass.

FResnel_On

This ball is rendered with “Fresnel Reflections”.
The reflections look natural for a dielectric material (non metal), because they are dim at perpendicular incident angle and intense at grazing view angle, hence seen mostly at the sides of the ball accentuating its contour.

Theoretically Specular Reflection for all types of materials should be calculated using what we refer to in CG by the term “Complex Fresnel”, that is reflection equations that take into account both the Refractive Index (IOR) and Extinction Coefficient for 3 primary colors (spectrum wave lengths).
*Complex Fresnel component values for different materials can be found on https://refractiveindex.info/.
In practice, for Dielectric materials (non metals), most common production rendering systems use what we refer to in CG by the term “Simple Fresnel” or “Simple IOR”, that is calculating the reflection for all 3 primary colors using a single Refractive Index value, which is the surface’s Refractive Index for the Green primary color.
This method has proven itself to be very efficient for rendering non-metallic surfaces (dielectric materials).
Rendering metallic reflection using Complex IOR produces the most realistic color and reflection* for metals.
*In metallic surfaces the color is the reflection color itself and not a separate Diffuse component.
Some rendering systems like Arnold 5 for example have implemented a general form* of Complex IOR into their physical surface shader, Complex IOR reflection can also be rendered via OSL shaders that can be found on the web (or written..).
*I’m using the term ‘general form’ because these implementations don’t include input for Complex IOR values but just a general metallic reflection curve, that interpolates manual color selection.

This golden monkey statue (“Suzanne”) is rendered in Cycles using a Complex Fresnel procedural node:BlenderNation

Popular useful cheats for mimicking metallic reflection without complex IOR are to set a very high (non physical) simple IOR value, like 15 to 30 which forces the Fresnel reflection to become more metal-like, or turn Fresnel reflection completely off, turning the specular reflection into a perfect mirror reflection, or create a custom reflection/angle curve/ramp that produces the effect of the metallic reflection color and intensity changing by incident angle, see example here.

In many popular production renderers, the physical surface shader uses a single IOR parameter. Some rendering systems allow using 2 different IOR parameters, one for calculating reflections and the other for calculating Refraction.
* physically correct dielectric materials should be defined with the same IOR value for both reflections and refraction. using different IOR values for reflection and refraction allows useful cheats like creating transparent a material that is modeled without any thickness or defining a transparent glass that has silver reflective coating like sunglasses sometimes have.

Notes:

  1. IOR lists on the web, that display only simple IOR values like this list, are not valid for metals, and produce wrong results.
    *Using simple IOR values for dielectric materials however is very efficient.
  2. There are parts in the CG industry where in daily slang language, the term “Fresnel” is used to refer to any shading effect that is view-angle dependent,
    Usually referring to the shading properties appearing at the “sides” or contours of the model.
  3. There are some CG systems that use the term Fresnel to refer to a simple linear or non-linear incident angle blending effect, that should actually be called “Facing ratio” or “Perpendicular-Parallel” blending (falloff).
    This is wrong because IOR based Fresnel reflection intensity produces a specific physical Reflection intensity/view angle function curve, and not just a linear or simple power function.
    See example in UE4’s Fresnel node.
  4. Some PBR rendering systems using implementations of the Disney principled BRDF don’t use a Fresnel IOR input value for dielectric materials, but instead use a simpler 0 – 1 (or higher) Specular input parameter that produces dielectric reflections of approximately 1.0 to ~1.8 IOR value range, which generally covers the range between no reflection at all to common gemstones.
    This approach may be inconvenient for rendering artists that are used to setting IOR values, but it has a significant advantage of allowing the usage of an LDR 0 – 1 range (regular image file) texture map for the Specular input, and that way be able to define different material reflections on the same object, rather than having to create a physical IOR map that has encode higher than 1 float values or be mapped to that range at the shading graph.
    * See Blender’s Pricipled BSDF and Unreal Engine’s PBR Material.
    * Blender’s Principled BSDF actually allows setting Specular values higher than 1 to render material denser than IOR 1.8 (like a diamond for example).
  5. Many modern production renderers use Schlick’s Approximation to render Fresnel reflections, a simplified Fresnel formula that is both faster to compute and better suited for microfacet glossy reflection models.

Related:

  1. V-Ray Next’s new metallic material option.
  2. Creating a rich metallic shader in UE4.
  3. Complex Fresnel Texture for Cycles.
  4. Rendering Transparencies
  5. UE4 – Basic architectural glazing material

Blender Cloth animation to Shape Keys

Software:
Blender 2.79

Steps for creating Shape Keys from cloth simulation: 

  1. Create an object with Cloth simulation.
  2. Give the Cloth Cache a name.
  3. Set Cloth cache to Disk Cache.
  4. Bake the Cloth animation.
  5. Move the time slider to wanted cloth state.
  6. Press the ‘Apply as Shape Key’ button on the Cloth modifier.
    * The cloth modifier will be deleted from the object.
    Untitled-1.jpg
  7. Apply new cloth settings to the object.
  8. Set Pinning to be the same Vertex Group if necessary.
  9. Give Cloth Cache the same name as before.
  10. Set Cloth cache to Disk Cache.
  11. Play the animation timeline so that the cache frames on disk will be loaded again.
  12. Repeat from step 5 for each cloth pose you want to turn to a shape key.