- Home /
Gradient blending textures from different vertex points
Background I'm working on a procedural terrain generator, similar to a voxel engine, except, instead of drawing cubes at a voxel point, I'm using voxel as vertex points It's worked well so far, but am unsure how to proceed with blending different textures from textures assigned at these points.
Current generation
The problem What i am having difficulty with is drawing textures from each vertex, which end up blending mid-way.
I have attempted to do with this shaders, but I don't have much experience other than the basic shader here and there.
Does anyone have any points/suggestions on a way to tackle this problem?
Thanks,
Raider00321
I don't understand from your question: you want textures to blend, or you want them not to blend?
If blend, then look at Unity Terrain shaders how they work. They do a shader pass for each 4 textures which first writes, then each pass adds color of texture with specified alpha (yes, each vertex has N alphas supplied where N is amount of textures used by terrain - only 4 gets sent to shader per call though). Blending of alpha is done automatically when you send it from vertex shader into fragment shader.
If not blend, then each voxel part that must not blend with neighbours must have separate vertices from each of its neighbours.
yup, I do want them to blend. I'll take a look and see if i can find the source for the unity terrain shaders, Thanks :)
Your answer
