#Post-processing shader not applying until camera rotates

1 messages · Page 1 of 1 (latest)

rotund blaze
#

I'm using this post-processing shader:
https://godotshaders.com/shader/high-quality-post-process-outline/

I'm also using Phantom Camera for my camera.

So, my camera is set up like so:

  • Camera3D
    • PhantomCameraHost
    • PostProcessOutline (as described in the shader above)

Everything works great except when the scene first loads, the post-processing shader is not applied at all. If I move my character around and the camera follows them, the post-processing shader remains un-applied.

The shader only applies itself once the camera rotates a certain amount. It's almost like the quad mesh that the post-processing is being done on isn't rotated properly until the camera itself rotates.

I can't tell if this is because of Phantom Camera, or the post processing outline itself, or some sort of combo of the two. If I move the quad mesh up a level to be not a child of the Camera3D, then the outline is applied when the scene loads but rotating the camera, you lose it.

Any ideas?

HOW TO USE:   1. Create a MeshInstance3D node with...

rotund blaze
#

It's definitely a hack and I'd love to understand why I need to do it, but adding this into my character's _ready() did the trick 😂

await get_tree().process_frame
var fake_event = InputEventMouseMotion.new()
fake_event.relative = Vector2(3.0, 0.0)
_handle_mouse_movement(fake_event)

Basically just faking enough mouse movement to trigger the outline showing up 🤷‍♂️

lucid mirage
#

I'm familiar with post-process outline shaders but not with phantom cameras. What does a phantom camera do?

#

I've never seen this with just a post-process shader, so i would guess it has to do with the phantom camera

still ivy
#

def try increasing the cull margin

rotund blaze
rotund blaze
# still ivy def try increasing the cull margin

Okay, it was the cull margin! I had near set to the default of 0.05 but I had placed the quad mesh that the effect is applied to at 0,0,0.

Moving it to 0,0,-0.06 and now the effect always works gdparty
This also fixed an issue I was having where it would stop working when the camera is pointed straight ahead gdplushcheer