Intro

This post showcases two individual pieces of work that happened to go together nicely. The first part demonstrates how the combination of a flow map, scrolling uvs and a gradient can be used to create a simple fire effect by distorting a base texture. I made this effect around the time I first started experimenting with writing shaders in ThreeJS so it was an ideal project to play around with.

The side window is currently showing the result of the first part of the post, the second part of the post covers a feature I added for fun in which you can draw a rudimentary flowmap. I originally anticipated this feature to be quite simple to implement, given that I have the drawing logic from a previous post but it ended up being more technical than I expected so it became an interesting thing to write about.

In this post I’m also experimenting with having the written content interact with the demo a lot more than in previous posts. This is done in two different ways, the first is when you change the page it’ll change the state of the demo to fit the written content. The second is that scattered throughout the post there’ll be input fields, buttons and sliders to allow you to change values within the demo. I’m excited by these features because I think it’ll make reading the post more fun, but I am aware that it could get annoying if you can’t find a button you want to press, so I’ve ensured that all buttons and input fields are available within the settings tab. I’ve also added additional features within the settings page, such as the ability to set your own base texture and to import a custom flowmap.

As was the case with previous posts, whilst this demo has been written in ThreeJS, there are no implementation specific details that mean it shouldn’t work in game engines such as Unreal or Unity, and it should also be possible to port to other frameworks such as BabylonJS relatively easily.

The next page covers the approach to UV distortion, so please continue if you want to read more.

Note - Because of how the blog currently works I don’t have a nice way to sync settings values, this will be a future feature but apologies for any confusion :)

Distortion Settings

Drawing Settings