Custom Baked Lighting “Engine”

Would you be willing to release the crossroads rbxl file to the public?

This is very nice, great job! But why would you want to use this over Roblox’s default lighting? Seems unnecessary to me.

1 Like

It’s designed for rendering lighting for maps that are completely static. This ends up being more performant on lower-end hardware than using future lighting for example, while still supporting realistic local light shadows and other features. Since lighting is only rendered once, this ends up being pretty performant and also means that lighting stays consistent for any graphics quality.

3 Likes

I attempted implementing surface guis at first, but I noticed that the processing time ended up skyrocketing compared to decals.

It’s always nice to see sometihng new pop up on the dev forum that isnt the usual. Pretty cool!

2 Likes

How to a render an entire map? Here I am just doing a baseplate with an extra part added to it, but it has the error exhausted allowed execution time
image
image

Tried increasing the render scale but that didnt fix either

That is due to it looping and doing too much stuff which cause it to exede the max time, YOu could either bake part buy part, Or, Modifies the sources to add a Wait() function or task.wait

Nice!
Two things that can be optimized though:

  1. There is no yielding which will cause script timeouts:
    Custom Baked Lighting “Engine” - #17 by intergravitation

  2. Since this uses workspace:Raycast I believe it could be optimized using the new parallel lua feature.

Its still performance intensive with many part, I suggest to use greedy mesh algorithm to combine parts
also why doesn’t my spot light cast good looking shadow, all my light basically does nothing

I’m going to add in some optimizations that were suggested. In the meantime, I suggest avoiding rendering parts that are too large and adding a wait to the renderMapPoint block in the Lightmap module.

Point lights are the only light types supported. Meaning all other lights will be treated as point lights.
Also, the max brightness you can have on a part is 5, and it takes a larger brightness value for the lights to be effective than Roblox’s regular lighting system.

I should’ve put this in the Things to know beforehand section, so I apologize for the confusion.

1 Like

Alrighty, I ended up modifying some things.

A yielding method and parallel lua has been added. Meaning the execution time for rendering is a bit faster. I also added some options for improving lag in the “Things You Should Know Beforehand” section.

Though I haven’t added spotlights yet, I changed the functionality of the lighting calculations to be more accurate to how Roblox calculates their lighting. This means that Brightness values for lights are properly calculated.

I also ended up replacing the demo place file and module on the post to include the updated versions.

2 Likes

Can I make the shadows very sharp? Roblox’s normal shadows are just pixelated.

there is no way to set this up, there is no instructions what do you want us to do other than download it :confused:

I figured that the “How Do I Use It” section covers how to use the system. The demo place file linked there is meant for those who don’t know how to set the system up themselves. In the place file, navigate to any script in workspace and read the rest of the “How Do I Use It” section to understand how it works.

You could increase sharpness by changing the texture id in the lightmap module and lowering the render scale. Setting the texture id to an a solid white image would remove any smoothness. Depending on the texture id though, you might need to also modify the extended render scale to compensate for the smoothing.

Can you leave a link to the source on GitHub if you can?

Here is the thing I navigated to any script in the workspace and I was stuck bc I didn’t know what I was told to put in them, I copied the line of code but I noticed most of that was in the script for me, so I put the line of code in the line where it had one parenthesis but I tried to where I didn’t understand what I was supposed to do

All I got from that was a bunch of red lines under my line of code as if it was written wrong.

Wow, this is really cool! Met you a while ago on Mustang’s Discord server and you got straight to Advanced lol. Never thought this was possible on Roblox

1 Like

ngl, this system + some optimizations and my own touches can make the ultimate lighting engine that can cover up some of the things the future lighting cant do.

My idea was to change the fps of the shadows or calculations of the shadows when it needs to.

Also unrender shadows depending on player range reducing calculations…

Also slap in some more lighting stuff into the engine with certain optimizations.

Move and change your wait. Try this:

task.wait(0.1)
end
task.wait(0)
end