Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | skershmadersh |
I have generated a MeshInstance using SurfaceTool, Mesh, and a bit of perlin noise using the SoftNoise script found in the asset store. Not ever having dealt with materials on Triangle Strip before I am at a loss. I set the color of the material to red using set_parameter and set the material of the surface. However the result of the following code snippet is a jet black square.
surface.begin(VS.PRIMITIVE_TRIANGLE_STRIP)
var mat = FixedMaterial.new()
mat.set_parameter(mat.PARAM_DIFFUSE, Color(1,0,0))
surface.set_material(mat)
for y in range(rows-1):
for x in range(cols):
surface.add_vertex(Vector3(x,y,terrain[x][y]))
surface.add_vertex(Vector3(x,y+1,terrain[x][y+1]))
surface.generate_normals()
surface.index()
surface.commit(mesh)
self.set_mesh(mesh)
Through some digging I have come to believe I am missing UV’s? This is my first project with Godot and procedural generation. I appreciate any input.