o3de / o3de

Open 3D Engine (O3DE) is an Apache 2.0-licensed multi-platform 3D engine that enables developers and content creators to build AAA games, cinema-quality 3D worlds, and high-fidelity simulations without any fees or commercial obligations.

Home Page:https://o3de.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature Request: Add ‘set/get visibility’ Script Canvas node for lights (like in Lumberyard)

pwalterscarb opened this issue · comments

There’s no set/get visibility Script Canvas nodes for lights like there was in Lumberyard. Can we get Get Visibility and Set Visibility script canvas nodes?

Otherwise, how do we turn lights on and off? I could set the light intensity to 0 but if I have a lot of lights with different intensities then resetting those lights later is much more difficult than just turning them on and off.

The alternative would be to get a list of all lights with their intensity values, store those somehow and then reapply them later. Not sure if that's possible in script canvas and would be considerable more work.

Screenshot of visibility nodes in Lumberyard
LY-Script Canvas

Screenshot of visibility nodes in O3DE
O3DE-Script Canvas

Found in Branch
https://github.com/carbonated-dev/o3de
Commit ID from o3de/o3de Repository
custom engine version 2310.2

Desktop/Device:
Device: [PC]
OS: [Windows]
Version [10]
CPU [Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz, 3501 Mhz, 6 Core(s), 12 Logical Processor(s)]
GPU [NVIDIA GeForce RTX 3090]
Memory [32GB]

We should probably add a visibility or active flag to the *LightComponentConfig structs to allow the user to control light visibility.
For example the DirectionalComponentLightConfig could add an m_visibility option and reflect that to the BehaviorContext.

void DirectionalLightComponentConfig::Reflect(ReflectContext* context)
{
if (auto* serializeContext = azrtti_cast<SerializeContext*>(context))
{
serializeContext->Class<DirectionalLightComponentConfig, ComponentConfig>()
->Version(10) // Added AffectsGI
->Field("Color", &DirectionalLightComponentConfig::m_color)
->Field("IntensityMode", &DirectionalLightComponentConfig::m_intensityMode)
->Field("Intensity", &DirectionalLightComponentConfig::m_intensity)
->Field("AngularDiameter", &DirectionalLightComponentConfig::m_angularDiameter)
->Field("CameraEntityId", &DirectionalLightComponentConfig::m_cameraEntityId)
->Field("Shadow Enabled", &DirectionalLightComponentConfig::m_shadowEnabled)
->Field("ShadowFarClipDistance", &DirectionalLightComponentConfig::m_shadowFarClipDistance)
->Field("ShadowmapSize", &DirectionalLightComponentConfig::m_shadowmapSize)
->Field("CascadeCount", &DirectionalLightComponentConfig::m_cascadeCount)
->Field("SplitAutomatic", &DirectionalLightComponentConfig::m_isShadowmapFrustumSplitAutomatic)
->Field("SplitRatio", &DirectionalLightComponentConfig::m_shadowmapFrustumSplitSchemeRatio)
->Field("CascadeFarDepths", &DirectionalLightComponentConfig::m_cascadeFarDepths)
->Field("GroundHeight", &DirectionalLightComponentConfig::m_groundHeight)
->Field("IsCascadeCorrectionEnabled", &DirectionalLightComponentConfig::m_isCascadeCorrectionEnabled)
->Field("IsDebugColoringEnabled", &DirectionalLightComponentConfig::m_isDebugColoringEnabled)
->Field("ShadowFilterMethod", &DirectionalLightComponentConfig::m_shadowFilterMethod)
->Field("PcfFilteringSampleCount", &DirectionalLightComponentConfig::m_filteringSampleCount)
->Field("ShadowReceiverPlaneBiasEnabled", &DirectionalLightComponentConfig::m_receiverPlaneBiasEnabled)
->Field("Shadow Bias", &DirectionalLightComponentConfig::m_shadowBias)
->Field("Normal Shadow Bias", &DirectionalLightComponentConfig::m_normalShadowBias)
->Field("CascadeBlendingEnabled", &DirectionalLightComponentConfig::m_cascadeBlendingEnabled)
->Field("FullscreenBlurEnabled", &DirectionalLightComponentConfig::m_fullscreenBlurEnabled)
->Field("FullscreenBlurConstFalloff", &DirectionalLightComponentConfig::m_fullscreenBlurConstFalloff)
->Field("FullscreenBlurDepthFalloffStrength", &DirectionalLightComponentConfig::m_fullscreenBlurDepthFalloffStrength)
->Field("Affects GI", &DirectionalLightComponentConfig::m_affectsGI)
->Field("Affects GI Factor", &DirectionalLightComponentConfig::m_affectsGIFactor)
->Field("LightingChannelConfig", &DirectionalLightComponentConfig::m_lightingChannelConfig)
;
}
}

Keeping it open for anyone to grab. This essentially requires behavior context bindings plus may require some internal plumbing.

Tagging @akioCL in case he has capacity after his current commitments are resolved.