I have been watching lots of videos on compute shaders, and decided to try to make a one in ROBLOX! But I got stuck on the first part, changing the color of pixels on the screen.
I need to change the color of pixels so when a shadow is detected it can change the color of the floor.
The light gray part is where it detects a shadow, so I need to change the pixels there.
Read before commenting
I do NOT want to use the built in ROBLOX shadows as they are bad and slow. Also I want to add reflections but I can do that myself.
If that’s the case, the solution is not Lua. Lua is extra slow, and can’t interact with the environment like the game can. In addition, it runs on your CPU and not through a graphics API/your graphics card designed for graphics, so it’s all around bad. You can change pixel color slightly with GUIs and transparency, but since you can’t just get the current pixel color, you can’t replicate it in exactness. Furthermore, just creating a full 1366x768 pixel grid with borderless frames is very laggy by itself, and last I used them, it actually stopped rendering the last hundred or so columns of them. It ate memory. There is no good way barring switching platforms to something designed for it, but unless you’re using C++ you are probably going to have a bad time.
There are none, but that’s not quite the whole issue. It’s Studio itself.
If you want to mess with rendering, then you need the ability to mess with things on the rendering level. So for a custom rendering system you will probably want to write a custom game from scratch in C++. Nobody does that though, it’s usually not worth it. Most people that do things like that use modules from other places - Physics by Havok, rendering by vRage, etc. Though other languages could technically access rendering APIs, DirectX for example does not support anything except C++.
Now, if you were to use something else like Unity or Unreal, you would have far more freedom with the rendering, however you likely not be able to access the rendering API directly either - not that you would need or want to. The point is, Roblox isn’t the software you want if you want that much freedom.
I might not fully understand the situation but a basic way I can think of doing something like this is having volumetric lighting and field of view. Meaning that you could place a part on the players face and make it so that when it touches another part (light block) then you could manually change the colour of each other part that you want to change colour. You’d also have to limit the range and find the nearest part to make sure it’s not detecting things through walls. It’s the only way I can think of interacting with light and not having access to how roblox studio renders it’s light.
if i’m correct you can make a custom renderer in roblox. you might wanna go check that stuff out. in the game’s settings there should be a selection of renderers if i remember correctly.
edit: just checked: open roblux studio, open a place, file>studio settings>Rendering>Graphics mode
Slow to the point where you stop counting frames per second, but seconds per frame, I tried it, I prefered rendering a single frame and sending it to a custom python server I ran on my computer to export it as an image file, or render it in roblox frame pixels, but with very low resolution so it’s pixelated.
Whenever people make shaders on Roblox they use frames. It’s really slow and pixelated. I can link a few if you want.
Edit: here is one by PoptartNoahh:
Here is another:
To answer your question, you can’t change the color of pixels on the screen, but you can make frames that cover specific pixels.
Hey! Wowo my post was linked here, I feel very special.
Yeah so these guys are talking a whole lot of fancy words, but the basic jist is you literally can not.
Roblox LUAU is the only language you have access to in roblox, and it can not access the pixels.
In my real time pixel renderer I use a lot of different systems to help speed up the process, and it’s open source so you can check it out!
Oh also this bit. Are you sure that’s a memory issue? The same problem is happening for me!! It’s literally like Roblox just stops rendering those frames, they’re there, they’re getting updated, but roblox won’t display them
Don’t correllate those two sentences. Eating memory is a separate factor. It wasn’t an issue in Studio on my computer, but theoretically a pixel should only be about 4 bytes of data. With a frame, you have 1366x768 (at the time) times the number of letters in the name (if they aren’t stored by reference), the 4 bytes of color, the position (which is typically not essential because you can just use array position), the size, Archiveable, etc etc etc. It’s a lot of bloat for a little color dot By comparison with any other pixel system, it more than eats memory - it devours worlds.