• he/they

Web and mobile developer, telepathic bridge, worm power, vitality drink

posts from @vavassor tagged #devlog

also:

I'm writing shaders for Unity to make things look like an Nintendo 64 game. And using Kokiri Forest as an example scene. The screenshots are the scene in the Unity editor.

Many N64 games used a layer of color to paint shadows and give color variation. These are "vertex colors" meaning there's a color for each vertex in the models.

I notice a lot of ripped game models don't have the vertex colors. So the color looks off! In Kokiri Forest, the vertex colors are subtle and mostly unify and ground the models.

I used GlideN64 Scene Ripper to get these models.



For this effect, the base simulation is fluid flow based on Jos Stam's Stable Fluids. Karl Sims' Fluid Flow Tutorial is a good explanation of this method. The color tends to diffuse until it reaches a gray or even color. So I also added Back and Forth Error Correction and Compensation to help with stability and reduce diffusion.

To make it interactive, I first pointed a camera at the screen. A camera in Unity can optionally draw motion vectors for what it sees. (see DepthTextureMode.MotionVectors) This is normally used to implement motion blur. But here I directly add the motion vectors from the camera to the fluid velocity. The green and red screen at the top shows the sum of the fluid velocity and the motion vectors. Also, to add "ink" to the fluid, the camera captures the player color. So the player's body is used like a brush on a canvas.