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

Rayportals: Disable fade-in effect for portals with to emissive texture #83

Closed
wants to merge 1 commit into from

Conversation

xoxor4d
Copy link
Contributor

@xoxor4d xoxor4d commented Nov 2, 2024

This small change disables the fade-in effect on rayportals that have no emissive texture set.

The issue:

Drawing a rayportal whilst having the runtime option "Portals: Fade in Effect" enabled results in a gray, non see-through portal:
const float16_t tFactor = portalFadeInEffect ? float16_t((surface.tFactor >> 24) & 0xff) / 255.0 : float16_t(0.0);

-> There is no way to set the tFactor for the surface via the api.

Screenshot 2024-11-02 112822

Now, I could disable the global fade-in option but that will also affect the actual game portals:
Screenshot 2024-11-02 112829

And with the fix:
Screenshot 2024-11-02 112415

@anon-apple
Copy link
Collaborator

Yeah that seems like a good way to do it, if the D3D API isn't providing a texture then I doubt the texture factor parameter will be set or intended to do anything.

Another way would be to offer a control to enable/disable the fade in effect per-material (along with other ray portal parameters) since that might be a bit more generic for games trying to use such things more beyond just this one issue. We didn't really have much need at the time when designing the system since it was only really used for Portal RTX and could just be a global thing like that, but as you point out that's sometimes unsuitable for other uses. Would be more complex to add all those parameters through the whole material pipeline though so I think this is fine for now.

@anon-apple
Copy link
Collaborator

This is merged in now in 912a614. Closing this now.

@anon-apple anon-apple closed this Nov 4, 2024
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.

2 participants