David Williams wrote:
That video looks great. I'm curious, how did you implement the adding and removing of material? One approach is too add or subtract a small amount to each voxel within the range of the brush, whereas another approach is to multiply the voxels by an amount slightly more or slightly less than 1.0f. I found both had their limitations, but I'm working at limited precision (8 bits) and I suspect that is the problem.
It's quite simple:
A material consists of a float between -255 and 255, this is simply added by taking density * 255
Next, I make a list of values 0 and below is air, next anything greater than 0 = a material and 255 = another material, anything in between is a mixture of the 2 materials, (note that I could have made more materials, but I was being lazy and had a lack of textures)
I'm actually looking for a new system for my materials, because I don't just want to rely on two materials, what if I have let's say 3 materials: sand, dirt, and stone, with my current technique you can only have two different materials blending (sand and dirt, sand and stone, and dirt and stone)
but, I can't blend all three together at the same time... Nor can this system produce both: [dirt and stone blends] and [dirt and sand blends], this is because I am using only a single in-between point made for two materials, and only two.
Also, I made a lot of improvements, mainly using a triplanar texture system (not mine, I just found a shader)