semi-transparent water rendering (TODO)
This commit is contained in:
@ -10,7 +10,7 @@ type WaterBehaviour struct{}
|
||||
func (WaterBehaviour) Static() bool { return false }
|
||||
func (WaterBehaviour) RequireDataset() bool { return false }
|
||||
func (WaterBehaviour) RequireBlockUpdate() bool { return false }
|
||||
func (b WaterBehaviour) Appearance(position itype.Vec3i, aux int, data itype.Dataset, w *world.World) world.BlockAppearance {
|
||||
func (WaterBehaviour) Appearance(position itype.Vec3i, aux int, data itype.Dataset, w *world.World) world.BlockAppearance {
|
||||
return world.BlockAppearance{
|
||||
Name: "water",
|
||||
Transparent: true,
|
||||
@ -22,13 +22,13 @@ func (b WaterBehaviour) Appearance(position itype.Vec3i, aux int, data itype.Dat
|
||||
aux int,
|
||||
data itype.Dataset,
|
||||
w *world.World,
|
||||
vertexArray []world.Vertex) []world.Vertex {
|
||||
vertexArray []world.Vertex, vertsWater []world.Vertex) (verts, waters []world.Vertex) {
|
||||
|
||||
if block := w.Block(position.Addv(0, 1, 0)); block.Id != Water {
|
||||
return appendFace(itype.YPlus, position, "water.png", itype.Vec3f{0, -0.125, 0}, vertexArray)
|
||||
return vertexArray, appendFace(itype.YPlus, position, "water.png", itype.Vec3f{0, -0.125, 0}, vertsWater)
|
||||
}
|
||||
|
||||
return vertexArray
|
||||
return vertexArray, vertsWater
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user