The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I am drawing an outline using the typical grow + front face culling + unshaded technique. However, I'd like to get rid of lines that are not part of the silhouette.

I figured it'd happen if I offset the geometry away from the camera.
The problem is - I was unable to figure that out in the vertex shader.

I am working with visual shader, but if something can be done with an expression there that'd be fine.

One pitfall here is that the offset vector I need is not just the Z axis of the camera - it's a ray from the camera center towards the vertex being considered - the angle here can vary.

Otherwise my outlines would be pushed towards the center of the frame.

I was trying to figure something out with transforms but no go so far. The best I could do was working only when looking from a certain direction.

Godot version Godot 4 Beta 3
in Engine by (217 points)

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.