Use of EditableImage for efficiently painting on large surfaces globally using regular RayCasts

Recently I’ve been curious about why EditableImage objects weren’t being used more for use as splatters, damage etc on surfaces; so I did some looking into the API.

Turns out the biggest drawback of EditableImage types is that the maximum size of one is 1024x1024, meaning if you were to just slap one on the surface of the baseplate (2048x2048), that would end up being about half a pixel per stud, or 2 studs per pixel.

The resolution on that, as you can imagine, is pretty much useless for any use case I mentioned above.

So recently I’ve been working on a Module that can take any given object, and split its surface into usable chunks based on a PPS (Pixels Per Stud), meaning the resolution can be varied.

The video below shows the chunk I clicked in, along with showing where I clicked using a :DrawCircle() call on the given EditableImage.

The resolution of the chunks below is 10, but it can be significantly higher with diminishing returns, as EdtiableImage types do have a limit on how many can exist at one time, meaning the higher the resolution in a given area, the smaller it should be to prevent memory issues.

Any feedback would be greatly appreciated, as I continue to work on this Module with the plan to release a game devised as a tech demo, and then once refined, a free module for use of the community.

1 Like

In the video, it’s shown that it makes a new editable image for every part, but what if you have a complex shape, what then? Won’t it then just make a lot of editable images?

For small and complex parts, it gets a bit complicated, as the limitations on EditableImage types is quite strict. It would in a scenario like that create quite a lot of them, which would cause a few issues. I’m currently trying to optimise this system to possibly prevent that, but the actual limitations are my biggest problem going forward.