How to access a mesh's next pass material?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By gayminik

I’m looking to do something to the effect of this:

var material = self.get_node(".").get_next_pass_material()
material.set_shader_param("albedo", Color(1,1,1))


:bust_in_silhouette: Reply From: sash-rc

Next pass material is a property of Material, not Mesh

var mat : Material = mesh.surface_get_material(0)
var mat_next : Material = mat.get_next_pass()

Also note you probably need to cast it as ShaderMaterial.