-
What do I want to achieve?
I want a smooth texture animation for my ocean on a skinned mesh. -
What is the issue?
There are some update visual glitches going on specific stripes (check the record)
You can see here perfectly working middle stripe and edges ones but not the other. -
What solutions I have tried so far?
- I’ve tried to round every single value linked to this part of the plane.
- I checked my texture if it’s seamless and it is because I took the Roblox ones to try it. I also have remade the Plane to check the UVMap
- I tried the same thing but with 25 unique images instead of the spritesheet (but you can’t since you cannot edit normalmapconcent via scripts).
- I’ve tried to lower the update time (for slower action but still the same issue)
- I’ve tried to change the offsets of the texture several times…
- Code
This is the piece of a module script that I use.
function GenerateNormal(position)
if position >= (Settings.NormalRows * Settings.NormalColumns + 1) then
position = 1
end
local row = math.floor((position-1) / Settings.NormalColumns)+1
local column = position - 5*(row-1)
local u = Settings.OceanPlaneSize.X*(column-0.5)
local v = Settings.OceanPlaneSize.Z*(row-0.5)
print(u,v)
return position+1,u,v
end
This is what I run in a RenderStepped event (clientside).
acc += dt
if acc >= int then
count +=1
if count >= 25 then
count = 1
end
pos,u,v = WaveTable.GenerateNormal(pos)
WaterMesh.Texture.OffsetStudsU = math.floor(u/ratio)
WaterMesh.Texture.OffsetStudsV = math.floor(v/ratio)
acc = 0
end
ratio value is here to check if a specific size of the texture would work but it doesn’t.
I hope you’ll have more ideas than me to solve this.
Have a nice day !