CastShadow Optimizer - user-friendly game optimizer with clean UI!

Hello!
I’ve recently been trying to optimize my game, since the Future lighting can become laggy very easily if you have a ton of parts. After some research, it turns out the cause of the lag is due to the fact that Parts have a property called CastShadow - by enabling this, shadows are created near light sources, but this also makes things a lot more expensive, as shadows are quite costly. The solution for this would be to only have CastShadow toggled in areas where detail is important - having CastShadow toggled everywhere is just needless lag.

So, to make the process simpler for myself and to spend less time on it, I made a small script. I thought it would be nice to share this script with builders and other fellow game designers, so I converted it into a plugin!
This plugin is very easy to use and is also very user-friendly. The UI is minimalistic and slick, too.

Example of the plugin in action:


The UI has support for light theme, too!

You can get the plugin here:
https://www.roblox.com/library/6329139609/CastShadow-Optimiser

How to use:

  • Select the part (or model!) you want to toggle
  • Press the key to toggle CastShadow - by default, this is X. You can change this, though!
  • Green means that CastShadow is off - red means that CastShadow is on.
36 Likes

Update 1.0.1:

  • For whatever reason, InsertService doesn’t like me inserting a UI library. Switched to game:GetObjects().
    Thank you @DiscombobulatedJack for letting me know of the issue!
1 Like

Really glad I could help! :blue_heart:

This plugin is extremely useful when you’ve got a detailed or realistic build which you’ve already gone down the path of using a bunch of cast shadows on several objects and need to take care of them simultaneously.

2 Likes

I like this. I thought this tried to find out if something is affected significantly by this setting, that would be cool to see but it’s probably decently hard to do that, (if not impossible right now) to get every light source and calculate if it’s gonna be affected or not. I know it’s decently easy to compare it to the sun position.

This is still really useful and definitely something I recommend if you’re a builder that’s using multiple parts, makes everything so much easier.

Good job on creating this, wish I had found this sooner.

1 Like

Nice plugin. Great for optimizing games. However, it’s creating SelectionBoxes with Archivable set to true and they’re not being deleted after unselecting. It’d be great if this could be added to make it complete.

1 Like

Good call! SelectionBoxes should definitely have .Archivable toggled off.
SelectionBoxes are intentionally not removed after deselection because they’re used in a cache to re-use selection boxes for memory, but it seems like there was a bug where they weren’t re-parented back to nil afterward.

1 Like

Update 1.0.2:

  • Addressed the issues mentioned above by @rabbi99 . Namely, SelectionBox objects now have .Archivable set to false, and are now properly re-used in a cache for performance.

  • Your settings now save! When making this plugin I wasn’t aware of the plugin::Set/GetSetting API, but now all the properties you changed in the UI should properly save across sessions!

1 Like

I appreciate the effort, Pyseph! I really do! I’m happy you come back to this topic after nearly a year. However, the plugin doesn’t seem to work anymore at all. It has something to do with loading the UI through your plugin’s script:

If it helps, you can put the UI in your plugin’s model instead and clone the content of it to your widget. I’ve worked with plugins before and I found this to be a nice and quick way of getting resources without the Roblox asset hassle:

image

I hope this final update will be the last crucial one :wink:

Hey, this seems to be an issue on your end in terms of HTTP requests not being parsed correctly, but I agree that the UI should be memoized under the plugin script. I’ll update it accordingly.

1 Like

Update 1.0.3:

  • Parented the UI framework under the main Plugin script, in order to not disrupt game workflow while potentially offline.

Side note: This issue was caused by the fact that Save as Local Plugin, which I use for testing, only saves the script itself - causing me to falsely believe that you weren’t allowed to parent any other children under a plugin script :L

2 Likes