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

Night Vision Light Sensetivity #5486

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

Rinary1
Copy link

@Rinary1 Rinary1 commented Oct 7, 2024

adds light sensetivity for night vision systems.

This not night vision, It's not about seeing people, it's about seeing everything, you can't draw everything on top.

Robust.Client/Graphics/Clyde/Clyde.LightRendering.cs Outdated Show resolved Hide resolved
Comment on lines 482 to 495
if (lastColor != component.Color)
{
lastColor = component.Color;
if (_lightManager.LightSensitivity != 0)
{
lastColor = new Color(component.Color.R * _lightManager.LightSensitivity,
component.Color.G * _lightManager.LightSensitivity,
component.Color.B * _lightManager.LightSensitivity,
component.Color.A);
}
else
{
lastColor = component.Color;
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than baking this in this is better done on the content side or alternatively via event.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than baking this in this is better done on the content side or alternatively via event.

wdym?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than baking this in this is better done on the content side or alternatively via event.

Could you explain how you see this? Sending an event here would be incredibly inefficient.

Copy link
Contributor

@metalgearsloth metalgearsloth Oct 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As opposed to calling GL.ClearColor twice in a row...?

The lighting cap is incredibly small anyway. Again, there's no reason you can't just update the lighting render target from content with this.

Copy link
Contributor

@metalgearsloth metalgearsloth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also another option is just drawing a texture to the LightRenderTarget in an overlay depending how you want to do it.

@Rinary1 Rinary1 closed this Oct 8, 2024
@Rinary1 Rinary1 reopened this Oct 26, 2024
@darkrell
Copy link

darkrell commented Oct 27, 2024

Also another option is just drawing a texture to the LightRenderTarget in an overlay depending how you want to do it.

Also, that solves a slightly different issue. we would still prefer to have local options for devs to adjust species sensitivity to light

@metalgearsloth
Copy link
Contributor

Also, that solves a slightly different issue. we would still prefer to have local options for devs to adjust species sensitivity to light

I still don't see why this can't just update the lighting render target from content.

@metalgearsloth
Copy link
Contributor

At this stage the only useful part of this I see is adding more customisation around what clearcolor is used but none of the other changes are necessary on the engine.

@Rinary1 Rinary1 force-pushed the night-vision-light-sensitivity branch from e450d28 to 18ccd7a Compare October 29, 2024 21:01
@ss14-Starlight
Copy link

@metalgearsloth

Rewritten to use the event; is it better now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants