Hello all. I am very new to Godot so I apologize if this is trivial. I am currently working with this script to plot two transparent cubes next to each other.
extends Spatial
func _ready():
var tr = 0.1
var node = plotCubeAt(Vector3(0,0,0), Color(0.7, 0.13, 0.13, 0.5))
add_child(node)
node = plotCubeAt(Vector3(0,0,3), Color(0.7, 0.13, 0.13, 0.5))
add_child(node)
func plotCubeAt(pos, color):
var cube = MeshInstance.new()
cube.mesh = CubeMesh.new()
cube.scale = Vector3(1, 1, 1)
cube.set_translation(pos)
var material = SpatialMaterial.new()
material.albedo_color = color
material.flags_transparent = true
material.flags_unshaded = true
cube.set_surface_material(0,material)
return cube
Here is the result. As you can see, the region in which the cubes overlap has a transparency that differs from the transparency of the cube in front. I am trying to get the scene to render in such a way that this region instead has the transparency of the cube in front. Is this possible? I'd appreciate any help I could get.
