0 votes

Hey there. I'm making a 3D game, and I need to make a slice shader (example).
I don't need it to be solid where the slice happened, but it would be nice. The way I'm trying to do it is using a shader material for the mesh I want to slice. If the fragment world position is inside the area culled, ALPHA = 0.. That brings two problems, though:

  • Apparently, setting the ALPHA for any fragment in the object makes it transparent
  • I can't get the world coordinates for the fragments in the mesh itself

If I follow this tutorial, I get the wold coordinates for the fragments behind the mesh.

Any ideas on how I can get it to work? :(

Edit: I solved the alpha problem. Just had to set the flag depth_draw_always. Still can't get the position, though
Edit2: For anyone else who needs help getting the world coordinates, someone on reddit gave me the answer

in Engine by (64 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 webmaster@godotengine.org with your username.