Scene rendering - difference between IDE and run

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By GameVisitor
:warning: Old Version Published before Godot 3 was released.

Hi all,
Can any one pinpoint to what might cause my scene to display / render differently between the IDE and the actual Run ?

First screen shot ( Screenshot from 2017 07 08 10 20 18 godot falling ide crop hosted at ImgBB — ImgBB ) from IDE : all nodes are rendered correctly :

Second screen ( Screenshot from 2017 07 08 10 20 50 godot falling run crop hosted at ImgBB — ImgBB ) from run-time execution, some nodes (the 2 far walls) render incorrectly, while other nodes are correctly rendered.

:bust_in_silhouette: Reply From: wombatstampede

My guess is that you enabled ambient light in your editor but have no ambient light in the scene.
You can do this by adding a WorldEnvirnment node to the scene and enable ambient light within.

See http://docs.godotengine.org/en/stable/learning/features/lighting/lighting.htm (near the bottom)

Another reason for different rendering could be the set up of the camera (i.e. view range) but this is not the case here I think.

Thx for ur feedback, the main root node of my scene is a WorldEnvironment.
The camera also have its own WorldEnvironment as environment property.

(I know they are different coz the one of the camera has the background as light green as u can see in the screens, whereas the main WorldEnvironment default to the black color).

-Enabling : Ambient light, Glow, or HDR in root WorldEnvironment scene has not effect at all.
-Enabling : Ambient light, Glow, or HDR in camera’s WorldEnvironment has not the desired effect, (of showing the correct rendering while running). Also it generates some kind of “vertical bluriness” as u can see in this new screen (https://ibb.co/kKPFxv): melted effect

Btw, i did read this link : http://godot-es-docs.readthedocs.io/en/stable/learning/features/lighting/lighting.html

before posting but it couldn’t help me :frowning:

GameVisitor | 2017-07-08 12:14

Avoid adding a World Environment to the Camera for now. That will just make things more complicated (WE in Camera should override WE in scene but it just makes it more complicated for now).

Usually, I use a Spatial as root node and the World-Environment as one of its child nodes. But that shouldn’t make a difference imho.

What to do:
#1 Switch off the standard lighting in the 3D view of your editor (Uncheck the checkbox under the “View” menu item in the Editors 3d View)

#2 Check in your World Environment that the ambient lighting is enabled.
#3 Check that it has a bright color (white). Ambient Lighting with Black won’t help much.
#4 Increase the Energy to 3 or 4. Your scene should get much brighter in the editor (and on runtime). You can reduce the Energy again later.

If all that doesn’t help. I’d need to have a look at the project to help more. Perhaps you could upload a stripped down version of your project somewhere.

wombatstampede | 2017-07-10 07:19

Indeed, following ur detailed steps showed my problem (std light of IDE). Thx for that :slight_smile:

However, now, even though at runtime my scene is illuminated it has this “vertically melted” effect (sorry can’t describe it better in words)

Here is a screen, hope it explains better ( Screenshot from 2017 07 15 22 35 29 crop hosted at ImgBB — ImgBB ).

PS: If i disable “Ambient light” of WE, the “melting effect” disappear but then my walls aren’t rendered correctly.

Could this be due to a camera settings (keep Ascpect, far, near…) or something related to the project as a whole (vsyn. stretch aspect, stretch mode…) ?

GameVisitor | 2017-07-15 19:53

Is absolutely difficult for me to tell from that single screen shot what is wrong or how it should look like.

You could play a bit with the texture (repeat?) and material flags.
You could add a (test-) camera with default settings and make that current (for test purposes)

Where these planes imported from a 3D-Editor (Blender)? If yes, you could check the face normals and enable the split to tris on export.

wombatstampede | 2017-07-16 08:29

I tried even without a texture, and the scene also looked melted down (only when ambient light of WE was on). A new test cam did not help either.

Nothing is imported from an editor trying to build everything from Godot using test cubes (stretched for walls).

In all cases, i upload my project to this link code if u care to have a look.
the password is simply test123456.

Thanks in advance.

GameVisitor | 2017-07-16 16:53

Problem in your project is the node2d your gui elements.
You made a Node2D as parent for your Controls. This lets somehow the display/stretch-settings of your project go crazy.

Use a “Control” instead of node2d as parent in the 2d_gui (sub)scene. And before adding the childs controls/labels, set it to your viewport size. (Anchor Begin,Begin,End,End, Margins all 0).

You can remove the “viewport” there IMHO.

wombatstampede | 2017-07-18 14:01

Thanks a lot for taking the time of opening the project and looking deeper for the issue.
I followed your steps as described and recreated the (sub)scene from scratch, removed all node2D however same result. (If ambient light of WE is on, scene is melted, else scene displays fine).

In case you can still have alook, here is my update code-updated

:frowning:

GameVisitor | 2017-07-18 15:21

Change the stretch-mode in the project settings from “viewport” to “2D”.

That should do it. (If not I’ll reupload your project for demo)

Setting the stretch mode to “2D” generally is a good idea IMHO…

See here:
https://forum.godotengine.org/1084/resolution-strech-mode-2d-vs-viewport

…but I absolutely don’t know why your “melting” was triggered by enabling ambient lighting.

wombatstampede | 2017-07-19 06:53

Amazing ! Solved finally and learned some new stuff along the way.
Many thanks #wombatstampede

:slight_smile:

GameVisitor | 2017-07-19 07:16