0 votes

for the purpose of seeing my map from a top-down perspective in 3D and the map's interiors not being obstructed by the roofs of buildings; i have a script for cutting off the alpha of all materials in my map above the height_uniform value like this:

(using render_mode world_vertex_coords;)

uniform float height_uniform = float(6.0);

void vertex() {
world_vertex = VERTEX.y;
}
void fragment() {
    if (world_vertex_y > height_uniform){
        ALPHA =0.0;
    }
}

but it needs to be re-implemented across all my map materials, and all my map's materials need to be in the shaderMaterial format to support it which is tedious as heck.
Is there no convenient way to apply this script across all materials?

if there's a way to Convert To ShaderMaterial via gdscript, then i could create a script for automatically implementing this functionality if there's no way for a script that overrides only the alpha value of the existing surface materials. but that's the final option.

Godot version 3.2.3
in Engine by (94 points)
edited by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.