How can I make a custom Shadow Renderer?

Hi there fellow devs, I am on a quest on making a custom lighting engine built on top of the voxel lighting engine.

The problem is, I don’t know how to make a shadow renderer script. I was thinking of using a group of decals and math.noise, but honestly thats something that i cant even figure out too.

Please help me on this situation.

Why am i making a custom lighting engine? Well its something i wanted to do as a project, so why not.

1 Like

Maybe you could look into this;

Yeah, I figured out a method.

What happens is that we get a bunch of rays that hit the same part then generate shadows from the part. This is done by possibly scrolling through all the rays then instance new a part with a decal for this thing. If we use this thing with a for loop, we can make it less frequent on instancing parts. But thats just my idea.

For storing Rays, I think instancing attachments to represent where the rays hit is also a great option, rather than trying to store all of the raycasts. This also should be done on the client, because i believe rendering the whole workspace on a server script is tasking.

Here’s a visual:

I actually tested a prototype of this method, the problem was that there were too many attachments being used. So Im trying to figure out how to get rid of attachments when the position of the part changes. Not only that, the behaviour is slightly different than expected but still works somehow.

Not only that I also realized that rather than using a part combinedd with a decal to achieve the effect, I figured out that why dont we just use beams? The whole point of the project is making performant shadows for voxel, so quality isnt the main focus here.

I was able to achieve this for something I’m working on with ViewportFrames and a bit of math - probably not super performant for most use cases but I figured I’d throw it out there.

1 Like

Wait what really? Please please tell me how you did it!