Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pwalterscarb opened this issue Apr 15, 2024 · 3 comments · May be fixed by #17788
Open
Assignees
Labels
feature/graphics/lighting This item is related to lighting such as punctual lights, GI, shadows, area lights, etc. good-first-issue Issue ready for a new contributor according to the help wanted guidelines. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.

Comments

@pwalterscarb
Copy link

pwalterscarb commented Apr 15, 2024

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]

@pwalterscarb pwalterscarb added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 15, 2024
@pwalterscarb pwalterscarb changed the title Feature Request Add ‘set/get visibility’ Script Canvas node for lights (like in Luberyard) Feature Request: Add ‘set/get visibility’ Script Canvas node for lights (like in Luberyard) Apr 15, 2024
@lemonade-dm lemonade-dm added sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio. feature/graphics/lighting This item is related to lighting such as punctual lights, GI, shadows, area lights, etc. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 17, 2024
@lemonade-dm
Copy link
Contributor

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)
;
}
}

@moudgils moudgils changed the title Feature Request: Add ‘set/get visibility’ Script Canvas node for lights (like in Luberyard) Feature Request: Add ‘set/get visibility’ Script Canvas node for lights (like in Lumberyard) Apr 17, 2024
@moudgils
Copy link
Contributor

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

@moudgils moudgils added good-first-issue Issue ready for a new contributor according to the help wanted guidelines. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 17, 2024
@moudgils
Copy link
Contributor

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

@lsemp3d lsemp3d self-assigned this Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature/graphics/lighting This item is related to lighting such as punctual lights, GI, shadows, area lights, etc. good-first-issue Issue ready for a new contributor according to the help wanted guidelines. sig/graphics-audio Categorizes an issue or PR as relevant to SIG graphics-audio.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants