-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
[Suggestion] Allow for more background transitions out of the box #1826
Comments
Thanks for the issue! What we have right nowYou can already achieve different transitions by creating a custom background scene and overwriting _fade_in() and _fade_out(). This means you could have a shader setup on your custom scene and tween the progress in those methods. It's not perfect though, I agree as it Your solutionWhile shaders can create quite cool transitions, they are not very beginner friendly at all. They are also a bit limiting as they only allow image-backgrounds (which to be fair the default background does too). But custom backgrounds can be made of different (possibly animated) objects. For those you might want to use very different ways of animating/fading them. I will think about different solutions to this a bit more. |
I agree that shaders are definitely not the easiest to learn and use, i do think that they can be more useful than you might expect. Scenes that have animations in them, you could probs makes use of a viewport's texture as one of the inputs. that could at least alleviate that bit of pain. If shaders indeed become usable for background changes, i think it would be no harm in providing some out of the box materials to use, i think that it would cover a majority of the people's needs and give enough examples for those that aren't satisfied with what you can get out of the box. I don't think they should be excluded because they are a more advanced topic, but if they are included it should definetely be in a way that makes them easy to interact with. |
I forgot to mention, but this might also be useful for the clear event, as it removed the background as well, useful for when you want to transition back into the scene (for example you are in a city and are done with an exposition dump by an NPC) |
Is your feature request related to a problem? Please describe.
During a visual novel it is common to change the background to go to a different "scene", to make those background changes feel nicer transitions are used. However in dialogic it seems that the only options are either a hard cut to the next background or a fade. It would be nice if it was possible to create your own transitions in order to create a more diverse experience while switching backgrounds. examples include:
Additionally the current background fade seems to have a small issue where the background can become noticably darker during a quick fade between two almost identical BG's.
Describe the solution you'd like
I think a nice way to give power into the developer's hand would be to allow shader materials to be passed to the background event. These shader materials would have 3 parameters in common:
When a background event happens, it would make use of the fade time to get the current progress. It sets the previous and next background parameters and from there the mechanism that currently handles fades between background can most likely be used to update the progress.
If a developer wants to create their own transition they can create a shader that has those parameters and even other parameters. Inside of the fragment function they can then decide how the transition should behave and they can tweak settings inside a shader material that they then pass to the background event. if no shader material is passed, it could fall back on a default shader material that does a fade like the current fade between background events.
This way the transitions become fairly plug & play and can easily be shared.
an example of how one of these transition shaders could look would be like so:
The resulting shader material would look like this
as mentioned earlier, progress, Previous Background and Next Background would be handled automatically by Dialogic's background event. But I as a developer can tweak the size of Diamond Pixel Size in the inspector until I find that it fits my needs.
After setting the Diamond Pixel Size to 50, it looks something like this
Describe alternatives you've considered
The alternative would be to create an extension module for this, but it would not have the same reach as compared to a built in feature. It could allow for people to share their transitions with each other without having to worry about different implementations that can differ in standards.
Another alternative would be to create your own scene and pass that to the background event, but this would require writing in gdscript and doesn't have the same image processing power as a shader running on a GPU.
The text was updated successfully, but these errors were encountered: