I’m still very interested in this project though its been over a month, any way I could use it yet live?
That’s good to hear, because I kinda lost interest in it. I think I’ll open-source the game so everyone can see it.
woooooo yeahhh baby thatswhatwebeenwaitingfor
Hello everyone!
The demo game is now open-source! You can see and edit the code if you want, but if you use it in your game, please credit me ^^
I did this, because I lost interest in the project. I hope you can do something with it.
Have fun!
Nah, I want to challenge myself, so ima script the lighting system myself while i can.
wait how can i change the distance of the beam when the player gets hit by the ray?
Place an attachment at the ray origin, place an attachment to the position where the ray hit something, create a beam between those two attachments.
ohhh, well that makes sense… couldnt wrap my head around that…
Hey, I got it to work! but, for 1 light source. I was thinking of making all lightsources( specifically spotlights) have the volumetric effect. I also made it a server script.
However im not sure if its ideal for performance. So i had 2 options in my head that im not sure to pick:
-
Make it local script, so that i can make it update calculations of any lightsource within a certain range of the player (locally ofc).
-
Use parallel lua, im not sure if its a good idea to use more cores of a computer to do this…but its to sepereate the load into bits for each core to work on.
Hello! Glad to hear that. Personally, I calculate every light that’s in range and visible on the screen. I highly suggest making it client-sided, otherwise it might make the server lag. I hope you luck with recreating this!
forogot to ask, I have an issue where rather than the effect show up when the spotlight is facing in front of the part, it goes anywhere else BUT the front of the part. This has been an major issue. So i would like to know: What CFrame calculations/Operations did you use?
Make sure you always calculate everything relative to your part. I always just multiply CFrames. Example:
local part = workspace.Part
local point = part.CFrame * CFrame.new(0,0,-5) -- this point is always 5 studs ahead of the part.
Yeah, but it keeps failing to appear in front of the part…
Either I found the problem:
Remember this code?
for x = 1, lightAngle, 15 do
for y = 1, lightAngle, 15 do
for z = 1, lightAngle, 15 do
--your code here
end
end
end
I changed the 1s of x and y to the negative version of the light angle
local lightAngle = Light.Angle
local Negative = 0 - lightAngle --ik this is dumb, but just in case it doesnt become negative.
for x = Negative, lightAngle, 15 do
for y = Negative, lightAngle, 15 do
for z = 1, lightAngle, 15 do
--your code here
end
end
end
And voila now its perfect
Now the problem is that the raycassts only work with half of the attachments…
Can you show me a video showing how it works for you?
sure, but let me just send you a place file in private messages. Because not only will half of the attachments not detect an object. The raycasts only happen when an object is in the opposite direction of the light. eg. rather than being infront of the part (where the light and effect is) it only works behind the part.
I tried it, it’s absolutely great lol. Only issue I experienced which is an obvious issue to have, is the lag. (My PC isn’t that great regardless)
Yeah, I’m sure I could optimize it even more, but I’m not working on it anymore sadly. Thanks for the feedback tho!
This is great, I do have a few suggestions though.
1- make it run on client so players can customize the update speed, fog density and general quality a little
2- fog should render in a certain range and only start updating when the scene infront of it changes(can be done with worldroot:GetPartsInPart() to detect when new objects move in front)
These are my ideas to improve performance, if you’re interested in ideas to make things look a little better just ask.
Well, I know this is very late and probably already know this by now, But use the Sunrays effect provided by roblox, it works just like volumetric lighting and its casted from the sun.
This looks great with high graphics quality, but it’s incredibly laggy on my laptop. Even when i set my graphics quality to just 1, I already get a low frame count.