Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Anubis-class Cruiser (12/20/24)

Author Topic: BaseCustomEntityPlugin doesnt render for two frames during system transition  (Read 533 times)

Lukas04

  • Admiral
  • *****
  • Posts: 627
    • View Profile

Have been rendering a the same thing (a full screen background) using two seperate custom campaign entities, so that when you swap between both systems, it should keep the same render, doing this to test some other things.

Doing so ive noticed that theres two frames in which the render function isnt called for either of them, which can give some off results.

Video of it below, you can see it with bare eyes and can see it stop rendering for the final frame in hyperspace and stop rendering for the first frame in the new system.
https://streamable.com/8trgew
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24997
    • View Profile

The screen actually fades out and then back in over the course of half a second (quarter second in each direction), so there'd be a frame or two where the viewport's alphaMult is 0, and the rendering code for a BaseCustomEntityPlugin won't get called in this case. I can see how this is less than ideal for what you're doing with it, though, i.e. rendering a background, which doesn't care about the alpha mult.

Edit: since it was easy enough, added:
CustomCampaignEntityPlugin.isRenderWhenViewportAlphaMultIsZero()
Defaults to false.
« Last Edit: June 02, 2024, 12:04:00 PM by Alex »
Logged

Lukas04

  • Admiral
  • *****
  • Posts: 627
    • View Profile

Ah, randomly stumbled on the post again, didnt see your edit at first. Thanks for the change!
Logged