+1 vote

Hi All. I am trying to build an FPS rig where the weapon is on a separate cull-mask and has a separate camera that is set to only see the cull-mask the weapon is on. (This is to prevent gun clipping).

So in the main scene I have the main camera that sees the world and I have a viewport with the first-person camera as a child of a TectureRect - this viewport is set to transparent bg. That way the weapon camera renders just the weapon over what the main camera sees.

This is working fine and all except one thing: some of the environment properties of the gun camera (the one that renders its view into the viewport) are ignored by the engine, such as DoF or post-processing effects like color correction, brightness, contrast etc.

In effect, even though the rig works flawlessly, the weapon looks out of place without color correction (like early vfx in movies).

QUESTION:
How can I replicate color correction on the viewport's 'content' to match it to the outside environment?

I've tried adding a shader to the textureRect that I'm rendering the viewport into, but it affected the whole scene BUT the viewport. Is there a way to color correct JUST what the viewport is showing?

Godot version 3.3.2
in Engine by (422 points)

I am trying to build an FPS rig where the weapon is on a separate cull-mask and has a separate camera that is set to only see the cull-mask the weapon is on. (This is to prevent gun clipping).

You don't need to use a separate viewport for this. You can scale down the gun and bring it closer to the player. Also, to simulate larger/lower FOV for the gun only, you can scale it non-uniformly.

this would work if it was o FPS game only but it's actually a third person game - I only have a contextual FPS mode which you can switch on in certain situations and it's basically just swapping cameras from 3ps to one that is located where they player's eyes are.

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 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.