Opaque Dragon test. It’s difficult doing this because only translucent objects can be masked by stencil. But making the dragon translucent looks sh*tty because of all the surfaces behind each other. So my approach:
The card and the parts of the dragon in front of the card write into a stencil mask
The ground is translucent, does NOT do a depth-test (so it’s rendered in front of everything) BUT is only shown where the stencil mask is NOT
added interactivity: pressing 1 brings the card up, pressing 2 sends it to attack pos, pressing 3 triggers dragon attack
Problems:
Environment can’t have shadows because you’d see them on the background
Card can not cast shadows because it would also be visible on the dragon itself
While it’s not a problem having an animation just running, for some reason, when i trigger it per keypress, the stencil mask is laggy and at the dragons mouth you can see edges where the background environment gets visible a bit.
Rough outline how the full sequence shall work. I’ll add a lot of impact/trails to the card itself and then the dragon shall spit a stream of fire (to the opposite side of the battlefield).
Small update: first test vfx (the fire stream is a simple crossed plane with a length of 1.0 and a blueprint calculates the distance from mouth to ground and stretches the plane accordingly and at the end is a particle system placed)
I’ve a material instance (1) which I animate via Sequencer (2) and it works great BUT it auto-generates a new material instance (3) which means, when I now change something in (1), the change is not taken over. I’ve to re-assign my original instance to the mesh first but as soon as I open/play the sequence again, another instance is dynamically generated. I wonder if there is a way to tell it NOT to generate new instances (or to apply changes to the parent instance automatically)?
@simonschreibt
You could maybe try making a MID in BP and assigning that instead of a static Material Instance.
I think they replace it because static instances cannot be animated on runtime
No, the texture would be stretched a little bit if the mesh is longer. But I think this will not be a bit problem. The stretching should not be too extreme and also I’ll add particles so that the stream isn’t the only visual element.
I tried but the problem is, that in Level Blueprint it doesn’t help as I’m not even starting the game when tweaking the material and animating. I’ve tried also re-assigning the material in a blueprint actor but it didn’t work out very well. Here is my summary of the issue:
Yeah, any bp of type actor will have a constructor that is triggered when the object is created, which includes being created by the sequencer.
If you make a dynamic material during that construction and assign it to the relevant material slot, you might be able to avoid it being overridden by some internal sequencer system.
@Niels
I tried that but the sequencer does not (re)create the object. What did work in some cases: clicking the object and moving it a tiny bit after the sequencer was closed. then the construction script was re-executed. It’s also possible to execute the construction script via sequencer but then it’s done every frame which means the sequencer has no control over the material anymore as the object gets the original material instance re-assigned each frame.
small update:
glowing border + swoosh is now red
twirl swoosh when card flips
card has a bit more time (and moves a bit further into the background) before slamming itself into the screen
@VFX1234 I’m not exactly sure what you mean but yes, it’s a lot of trying and tweaking. I’ve changed my approach now. The ground plane is now translucent and renders always on top but I can show other translucent geometries by setting them to a higher sort order.