0 votes

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

-Control node
----Viewport container node
---------Viewport node 1
--------------Camera node
--------------Directional light node
----Viewport container node
----------Viewport node 2
--------------Camera node

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?

asked Jun 1 in Engine by God Of Theory (43 points)
edited Jun 2 by God Of Theory

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