Posts

Showing posts with the label Materials

Water System Reflection (I mean thinking not actual mirror reflection)

Image
I was advised that I needed to add some kind of 'box' to work with when creating the fluid simulation. There are a lot of new features I can constantly keep adding but this could lead to spending too much time on one aspect when I need to be exploring other methods. I was initially going to make the ultimate water system (Mwahaha!) but I need some point where I can call it done. I need to look at some games I really like and base my fluid simulation on those games. So here are the games I really like the water systems in and why: Zelda Breath of the Wild - The water system in this game can reach out and influence other aspects of the game such as making certain objects have buoyancy, get manipulated by weather- water dissipation and many other aspects . Also known as being systemic as mentioned by Mark Brown from Game Maker's Toolkit: https://youtu.be/SnpAAX9CkIc. However, you cannot swim underwater like the previous Legend of Zelda games. Water Dissipation in Zeld...

Fluid Surface Simulation for multiple objects

Image
The water surface at the moment was limited to the trace input and the pawn. I wanted to try and find some way to make the simulation work for any objects. On the Beginoverlap and Endoverlap nodes, I removed the 'cast to' node and made it so that any actor overlapping can make the ripples. For some reason, didn't work and it seemed to only still work for the pawn. Then I remembered that the Mesh collision settings were set to pawn only. After setting to overlap all the blueprint works with multiple objects. Begin and End Overlap for any overlapping objects however it only works per object and not for multiple objects However, there were two problems with the blueprint. One is the BP only reacts to latest overlapping objects. The second being the blueprint reacting to one object at a time, so if I have two objects overlapping with the blueprint at the same time, then the surface will only choose one of the objects and make a ripple. I need to make it so it works with a...

Fluid Surface Project

Image
Before i could begin making the dynamic water simulation, I needed to wrap my head around render targets. It seems to be that render target is something that has been added to UE4.  I've been following a tutorial from the UE4 documentation on ‘Creating a Height Field Painter with Blueprints and Render Targets’: https://docs.unrealengine.com/en-us/Engine/Rendering/RenderTargets/BlueprintRenderTargets/HowTo/HeightFieldPainter Heightfield Painter in action After creating this i then moved onto the tutorial on how to ‘Create a Fluid surface with Blueprints and Render Targets’: https://docs.unrealengine.com/en-us/Engine/Rendering/RenderTargets/BlueprintRenderTargets/HowTo/FluidSurface However, the problem with this tutorial is that it became confusing as it tells you to create variables from the Heightfield tutorial and skipped a lot of information. So I used information from the content examples project for some assistance in creating the fluid surface. I deconstructed and s...

Bottled Fluid simulation Bug - Solved!

Image
After extensive testing and various debugging methods, I finally figured out where the problem is.  The clamp node I had didn’t allow negative values. However, whenever I enabled negative values and tested the bottle, the sine movement wasn’t working. It turns out  that I was moving the bottle through a small distance which meant the negative values were cancelling each other out thus making the sine very subtle. I didn’t see this until I finally moved the bottle at a larger distance. The Finterp Node was also the main culprit as it really hard to notice the problem and the interpolation speed was slow. Now, I need some sort of multiplier that would make the interpolation speed faster for shorter distances and slower for longer distances. Here is the screenshot with new changes: This creates another problem- the sine motion goes crazy for physics based bottles with the newly implemented interpolation speeds for the Finterp Node. Physics based bottles worked fine with ...

Bottled Fluid Simulation Bug

Image
After testing the fluid simulation, I noticed a major design flaw in the material and that is the Sine motion of the fluid seemed to move diagonally. This means that the sine was combining all 3 directions (X,Y and Z directions). To fix this, I used an append node to separate the values and create separate scalar parameters which can then be controlled via Blueprint.  Separated values with the append node in th material Added changes to the Blueprint This has somewhat worked as the sine now moves in X and Y and doesn’t exclusively move diagonally when moved in X and Y directions. However, another issue has appeared where the diagonal movement of the sine wave is not moving in the opposite direction when the object is moved diagonally in the other direction. The directions the sine wave of the fluid moves along when the object (bottle) is moved. The sine does not move along the yellow directions, it somehow moves in the blue directions instead. the blue direction...

Fluid Simulation in Bottles

Image
This was a fairly old project but i migrated it into this project to implement new changes. I found a blog post by Simon Trumpler about Boomer bile/puke flask in Left 4 Dead 2 game:  https://simonschreibt.de/gat/left-4-dead-2-puke/  This used Rigging and animation to simulate fluid in bottls. He also explores how other artists have made fluid simulation in bottles, the one by Tyler was very interesting. I also found a twitter post by Joyce [MinionsArt] where someone used this same technique but added a Sine movement to it:  https://twitter.com/minionsart/status/986374665399685121  Even though it was designed for Unity Game Engine, it was really easy to understand the script when combined with Tyler's Fluid simulation. It did require experimenting with the Start Preview node in UE4. Fluid Simulation in a bottle UE4 This actually gave me the idea of adding UV distortion to the material to create my own version of  fluid simulation in a bottle. I ...

Rain Material

Image
I was hoping this experiment would be a small project but it took a bit of time as I kept wanting to add extra functionality to it. The masking concept from tri-planar mapping/ WorldAlignmentTexture node gave me an idea. I decided to make dynamic rain material, whereby rain ripples appear at the top, raindrops slide down the sides and there is no rain at the bottom. Here is the material in action: Final Rain Material The ripples at the top is a flipbook, made by following Josh Trevisiol's Raindrop flipbook tutorial: https://www.youtube.com/watch?v=2dpFtqlWt1o   As for the rain texture, I painted 3 different variations of raindrop texture into a graypack. The first two are panning slowly and being distorted to give it the realistic motion effect of rain sliding. The 3rd texture is very subtly panned as well but is being masked by noise to make it fade in and out. Adding further variation, I then baked the normal map information in Knald using those 3 painted heightmaps....

World alignment (Tri-planar mapping)

Image
From reading the UE4 documentation, I found out that material functions are a bunch of nodes packed into one node. I figured out the Math behind how world alignment works by deconstructing and experimenting with the World Aligned Texture node. This node is one example of a material function. It is also widely known as Tri-planar mapping in substance painter. Material Function for Tri-planar mapping  This gave me the idea to make a block out material which can have grids, scale without texture stretching and change colours the way I want it to. I also wanted to add the functionality of animating the material. I did this by making some modifications to the World Aligned Texture material function. Modified Material function with comments to help understand which part is doing what. I found that substracting the WorldPosition from the Object Position will force the material to move along with the object and not have a weird scrolling effect whenever you move the obje...

Mo' VFX

Image
I've never really made an effect using flipbooks so I thought I'd try learning the workflow used in the Games industry in creating a fluid simulation and make flipbooks out of it. I went  through the Imbuefx tutorial on Fluid Dynamics and Explosions in UDK:  https://www.youtube.com/watch?v=3kJr5wC_oyY&list=PLoAbgsIP97amgAQgdg2dwJLIE1FEVBg2H  I adapted the particle to Niagara. Final Explosion Particle made in Niagara  On another note, Maya's method of fluid simulation and rendering has been really frustrating. All I wanted to do was to just make a flipbook but the process was agonisingly slow. Anyway, I pushed on as I felt it was important to learn with it being a standard technique used in industry. Hopefully, I'll move onto something a lot more simpler and faster in the future like Embergen by JangaFX (currently under development.) Embergen might be a blessing for VFX artists around the world who just need to make flipbooks. 😊 https://jangafx.co...

UE4 Math Hall and Niagara Particle system

Image
Niagara I was also exploring the new Niagara particle editor In UE4 and I thought i'd try recreating the dust particle from the starter content which uses the old Cascade Editor. I have had some experience with the Cascade Particle in the past and stacking modules but Niagara on the other hand, is amazing because it gives you more control like make your own module using the node editor and then stack them up to get the result you want.I then decided to convert the dust particle to Snow. In Unreal engine v4.20, Niagara was at experimental stage and it was missing Rotation Rate module like cascade has. I didn't want to try using the node graph and make my own module as i was still getting my head around the main  area. With some help from UE4 discord server, i was able to get rotation rate via this hacky workaround. i kept nesting dynamic inputs until i got the rotation rate. Its actually funny how nesting dynamic inputs can give the result you want and makes it a lot eas...