#SD3 sun
1 messages · Page 1 of 1 (latest)
The CPU will end up burning 🔥
Maybe physgun can set you up with a dual-cpu refraction calculation server
The same calculations can be used to make a realistic ant-burning magnifying glass swep
Just think of all the applications
Currently I'm just winging it, but to get the true sunset and sunrise, you need to calculate it 96 times pr day for a pr 15min basics. For atmo refraction
Only to be +-1 minute more precise

The return hinting goes type varname so "The" is being taken as both return value names
Lol yeah that gets me a lot
You can use a # as a way to denote "No return name"
---@return number # The sunrise time in seconds.
That would also work
I pray for your CPU's
That doesn't look so bad... should it?
A little float multiplication never hurt anyone
I only use math.* functions 48 times 
For all sun info, yes. But will be able to remove a lot of them. You don't need to know the sunset and sunrise every frame. Only the sun-pos
If it's a real performance problem, there are some micro-optimizations you could make around math.rad and math.deg
Curious to see how the performance is in practice
I bet I could chew through that
Send code + inputs
Does this look right?
local n = 0
local t = 0
for i = 1, 100 do
local s = os.clock()
sunrise_sunset(2024, month, day, 6 * 60, lat,lon, UTCoff)
n = n + (os.clock() - s)
t = t + 1
end
print(string.format("%f", n / t))```
Cause it reports 0.000018 sec. Think JIT loves math
As long as you don't use any NYI yeah jit will zoom zoom
Maybe use the return value though
No diff
I think I heard something about jit skipping functions that have no effect (they do nothing and their return isn't used)
Then what were you worried about?
You can run that baby 5k times a second
I'm suspicious of knowing the outcome of a statement without executing it
CPU's from 2004 that can't do math.sqrt before exploding
But fair
Uh it can read code? 4head
Honestly not that common these days
I had a guy last year who still ran DX8. GPU didn't support DX9
We can't save everyone
Some people will have a bad time
Just hopefully not very many
That's what we call "not included in the target demographic"
OoS (Out of Scope)
@vagrant lake Tried the south pole
Sunrise and Sunset
Forgot the sun come back Sep 21
So that kinda works
When is the update that calculates the output of solar panel entities based on the sun's position and weather?
I'm joking, but now that I say it that seems like it might be do-able
Already kinda did that, no need for this. Just vector.cross env_sun data with position
You'd need to sample the surface of the panel to check for shadows
