Its not the atmosphere, I deleted that. It seems that its not related to the mesh, but rather the reflection distance limit on any part surface. I added a big part with a texture and it does the same thing as you zoom away the reflection does not render(and so you lose the perception of waves and depth).
Look at the sun reflection in the first shot, then in the second screenshot it is gone(along with the wave reflections)
Its a limitation in the lighting technology. Your map was on Compatibility. I changed to Shadow Map and it renders the reflections up to 600 studs. Better, but still not enough to be useful for flying.
It was from an old plugin of mine, I have since removed it. You can just delete the script, I should probably update the demo place. However the virus doesnāt do anything, I have done toying around with it, it has stopped working. I reccomend you remove it, it was inserted by a plug-in of mine.
A simple delete should stop the virus, not sure what it does.
Very nice module! I think you could do a lot more with this than just oceans, for example moving trampolinesā¦ Or netsā¦ Speaking of trampolines and nets, does the module provide any possibility to change the settings after the Wave object is created, such as gradually reducing the timemodifier or wavelength?
Yes! The :ConnectRenderStepped() method on a wave updates the wave every frame based on the wave settings. You can edit the properties on he wave object itself and it will update automatically. This weekend I plan on adding a function to update the wageās WaveSettings to make what you describe easier to do.
Iām having some trouble trying to add my own function into the module for finding the height of the waterās plane given a coordinate, iād assume itās just plugging in the target position into the gerstner function + account for perlin noise, but mine appears to be out of a sync the farther i get from a bone. Am I handling this in the right way? I suppose another way of solving this would be approximating height based on the closest surrounding bones, but I have no clue which method would be more efficient. Hereās what I have so far, itās not much-but the main problem iām trying to troubleshoot is the āde-syncā
function Wave:GetHeight(pos)
local Settings = self._settings
local Direction = Settings.Direction
if Direction == EmptyVector2 then
--account for noise (havn't done this yet, so I just set the Direction to Vector2.new(0,1) for the meantime )
else
Direction = GetDirection(Settings,pos)
end
return (Gerstner(pos,Settings.WaveLength,Direction,Settings.Steepness,Settings.Gravity,self._time).Y)
end
I barely got by in Pre-Cal 1, so pls b kind if iām missing something obvious.
edit: Iām also just using a BodyPosition to position the character on the Y axis, and it seems responsive enough so iām assuming itās a fault with my implementation.
This is because the gernstner wave formula returns a x, y, and a component, meaning that the x and a components are not always the same. You are simply ignoring the x and z components, making it appear delayed because the corresponding y axis belongs in a different x and z position. I reccomend going with the second option. You might be able to use @Quenty ās octree tree module to find closest bones. You might have to average the y positions in the bones. Hopefully Roblox will add physics and collision to support to bones and skinned meshes to make this process automated.
Thank you very much for your reply, you definitely led me in the right direction. Although even after getting the mean average of heights of nearest bones-the accuracy is still a little off. I know I should probably do more than just average the heights, but iām not sure whatā¦ I tried doing a weighted average by assigning low weights to farther bones, and then averaging them-but that failed as well. I really want to find a slightly more accurate way to approximate without increasing bone density. Any ideas?
local RunService = game:GetService'RunService'
local ReplicatedStorage = game:GetService'ReplicatedStorage'
local Player = game.Players.LocalPlayer
local RootPart = Player.Character.HumanoidRootPart
local Plane = workspace:WaitForChild("Wave"):WaitForChild("Plane")
local BodyMover = Instance.new'BodyPosition'
BodyMover.MaxForce = Vector3.new(0,math.huge,0)
BodyMover.D = 625
BodyMover.P = 20000
BodyMover.Parent = RootPart
local LoadCustomLibrary = require(ReplicatedStorage:WaitForChild("Nevermore"))
local Octree = LoadCustomLibrary("Octree")
local planeOctree = Octree.new() --no idea if i'm using the octree module correctly/efficiently, but it seems simple enough
for _,v in pairs(Plane:GetDescendants()) do
if v:IsA("Bone") then
planeOctree:CreateNode(v.WorldPosition,v)
end
end
local sampleRadius = 100
local maxSamples = 3
RunService.RenderStepped:Connect(function()
local closestObjs,distances = planeOctree:RadiusSearch(RootPart.Position,sampleRadius)
local sum = 0
--for _,v in pairs(closestObjs) do --unsure if this is less efficient or not, probably dependant on num of samples
-- local pos = v.TransformedWorldCFrame.p
-- sum = sum + pos.Y
--end
--local average = sum/#closestObjs
local numSamples = math.clamp(#closestObjs,0,maxSamples)
for i = 1,numSamples do
local v = closestObjs[i]
local pos = v.TransformedWorldCFrame.p
sum = sum + (pos.Y)
end
local average = sum/numSamples
BodyMover.Position = Vector3.new(0,average,0)
end)
Actually forget what I said about averaging, how about you use the Octree module and find the closest bone. As long as there are enough bones, it will be accurate enough.
Is there a way to run :ConnectRenderStepped() on variable frequency (1-60hz for example), depending on how far the character is? It lowers FPS a lot in my game.