Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » Translucent and glow stamping
- pro-diamondblade
-
Scratcher
18 posts
Translucent and glow stamping
When I was making a game, i had to stamp many glow objects at once every frame. However, it started to lag even on turbowarp. I then switched to solid non-translucent objects with the EXACT script and the lag completely went away. Is there a way to reduce the lag without reducing the amount of glow stamped? I know that it would lag because scratch needs to calculate and blend the translucent stuff with other stuff in every pixel, while stamping solid objects just replace the colour of those pixels without calculation. So im just seeing if there are any solutions to reduce lag.
(My game is glow-heavy while removing them makes the game look not nice
, pls help)
Link: https://scratch.mit.edu/projects/1374718196/
Its a slither.io game. Hold space to increase length for testing. When ur length is long (like a few thousand) and u accelerate, there will be many glow objects stamped and it lags even in turbowarp if ur whole snake is on screen(cuz there are many glow objects stamped). How to reduce lag while stamping many translucent objects pls helpppp
(My game is glow-heavy while removing them makes the game look not nice
, pls help)Link: https://scratch.mit.edu/projects/1374718196/
Its a slither.io game. Hold space to increase length for testing. When ur length is long (like a few thousand) and u accelerate, there will be many glow objects stamped and it lags even in turbowarp if ur whole snake is on screen(cuz there are many glow objects stamped). How to reduce lag while stamping many translucent objects pls helpppp
Last edited by pro-diamondblade (Aug. 25, 2026 13:52:17)
- Maximouse
-
Scratcher
1000+ posts
Translucent and glow stamping
I don't think you can make stamping faster without reducing the number of things you stamp. But there are likely other parts of the code whose performance can be improved – if the rest of the project is faster, the glow effect won't cause lag as quickly.
- Maximouse
-
Scratcher
1000+ posts
Translucent and glow stamping
Just as an example, I'll show one thing that isn't hard to optimize. You have several bits of code that look like this:

This code does the same thing, but it's much simpler and also slightly faster (because it doesn't have the “repeat (180)” loops):

This is just a small optimization and won't fix the lag issue by itself. I think it's best to focus on code that is repeated for each segment of the snake, because it can be a source of lag when the snake gets bigger.

This code does the same thing, but it's much simpler and also slightly faster (because it doesn't have the “repeat (180)” loops):

This is just a small optimization and won't fix the lag issue by itself. I think it's best to focus on code that is repeated for each segment of the snake, because it can be a source of lag when the snake gets bigger.
- pro-diamondblade
-
Scratcher
18 posts
Translucent and glow stamping
Ohwow it works!!! Thanks for the optimization! I thought u needed to +360 mod 360 to make negative numbers positive but it turns out that u dont! Huge thanks for the optimization. Stamping translucent stuff is much slower than stamping solid stuff, and i wouldnt be surprised if i cant make stamping faster. Im quite new to the forums, do i close topic?
- pro-diamondblade
-
Scratcher
18 posts
Translucent and glow stamping
Ill give u a shoutout in the description of the final project!
- Maximouse
-
Scratcher
1000+ posts
Translucent and glow stamping
Im quite new to the forums, do i close topic?You don't need to. Maybe someone else will have more suggestions.
Last edited by Maximouse (Aug. 26, 2026 15:16:53)
- Discussion Forums
- » Advanced Topics
-
» Translucent and glow stamping