How to use WorldEnvironment node in 2D?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Diet Estus

I am working in 2D and want to play around with the parameters in WorldEnvironment. Mainly, I want to experiment with fog and lighting.

How do I either (1) access the default WorldEnvironment to change parameters, or (2) create a new WorldEnvironment node to change parameters?

I usually find the Godot documentation sufficient, but this time I couldn’t find the answer in it.

I’ve tried adding a WorldEnvironment node to my camera, which is Camera2D child of my Player node. I created a new Environment resource for it. But I am not seeing any effects when I fiddle with the parameters.

I notice that the 3D Camera node has a parameter for an Environment resource, but the Camera2D does not. So, is there a way to change the WorldEnvironment when working in 2D with a Camera2D?

This GitHub issue seems to be related. There seems to be some confusion over whether WorldEnvironment is applicable to 2D.

:bust_in_silhouette: Reply From: SIsilicon

I’m pretty sure World environment only applies to 3D scenes.
Notice how most of the settings inside it are meant to be used in 3D.

  • DOF blur near and far
  • SS reflections
  • SSAO etc.

If you need stuff like bloom and color correction, those can easily be created using a polygon covering your camera2D’s view, a high z value to make sure nothing covers it, and a custom shader material.

Edit:
Fog in 2D? No offence but unless your talking about height based fog It sounds kinda silly.

:bust_in_silhouette: Reply From: Bot.13

Hey,

Dunno if you solved this already but inside the environment change the Mode to canvas.

Hope this helps.

Kind regards,
Bot.13

Thanks, it work for me…here my screenshot me applying the glow effect in 2d

Alvin Septiano | 2020-08-23 17:47

Made brightness and contrast sliders with that, thanks for the info!

IvanVoirol | 2020-08-29 21:18