0 votes

I have multiple viewports in my scene.
Something like this(simplified version):

-Control node
----Viewport container node
---------Viewport node 1
--------------Camera node
--------------box.tscn
--------------Directional light node
----Viewport container node
----------Viewport node 2
--------------Camera node
--------------box.tscn

As shown,I placed a directional light under viewport node 1,but I can also see the effect of that directional light on viewport node 2,which shouldn't be the case.

What I've tried:
1)I've changed the color of the light in viewport 1 and the mesh under viewport 2 gets affected and changes colour.This confirms the problem that the light is sharing between viewport.
2)I've tried creating a directional light under viewport 2 using code,but with different properties.However,there is no changes/effect at all.It still uses the light from viewport 1.
3)I've run and debugged the game several times using the debugger,print() and the remote server,but I can't find anything wrong.

My question:
What is actually happening?

in Engine by (46 points)
edited by

,I've solved it by setting the own world property of the viewport to true. However,I'm still not sure why it happens though...

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.