Using noise on vertex color

Questions & AnswersCategory: ProgramingUsing noise on vertex color
R3volve asked 1 year ago

Hello,
I understand that uTerrains uses vertex color to determine what textures to show on individual voxels, however I am using a vertex shader and prefer to use vertex colors to color the world.
I did this in my homegrown voxel world which I abandoned for the much more powerful uTerrain engine. 
However I do not know to add the code to run the noise function to interpolate between vertex colors in uTerrains. I am heavily inspired by the art style of the vaporware game CubeWorld would would like to reproduce something similar in uTerrains. Could anyone point me to where the vertex colors are applied in the scripts so I could interpolate the colors with some perlin noise?
Thanks!
CubeWorld

4 Answers
uTerrains Staff answered 1 year ago

Indeed, you should implement your own class that inherit from abstractvoxeltypefunctions.
With it, you can implement the method to get vertex color depending on its position, and this is where you will use Perlin noise (or anything you want).
Then, you have to assign your script in the ‘Voxel Type Function’ field of your Voxel Types.

Let me know if you have issues implementing this.
Also, I think I’m going to close the Q&A section of this website and open a Discord server instead, because sometimes I don’t receive notifications and don’t see the new questions.

uTerrains Staff replied 1 year ago

(and in the mean time, you can also use the official forum thread: https://forum.unity.com/threads/uterrains-ultimate-terrains-voxel-terrain-engine.383959)

R3volve answered 1 year ago

Anyone? I found where the vertex color is assigned, (abstractvoxeltypefunctions) but I dont know where the vertex x/y/z location data for the voxel is, or how to get it to where the vertex color is assigned…

R3volve answered 1 year ago

Anyone? I found where the vertex color is assigned, (abstractvoxeltypefunctions) but I dont know where the vertex x/y/z location data for the voxel is, or how to get it to where the vertex color is assigned…

R3volve answered 1 year ago

something went wrong with the image link and I cant seem to edit my own post. so here it is.