Jump to content

Cheap water


Crazycarpet
 Share

Recommended Posts

I feel like it'd be great if there was a way to create almost an "environment probe" or something over water, or the area you'd be standing in, that'd make it become "cheap". Cheap water being water without reflections, or any of that really resource intensive stuff. I think in scenes with distant water there's no need for the reflections and huge FPS drop.

 

I think It'd be really cool if there was a way to have inexpensive water in the distance at some point in LE's future.

Link to comment
Share on other sites

Here is a water material I've made. Apply it to a face of a box brush and set the collision type to trigger.

 

You also need to add this script to it so it animates the normal map. This is based off an old script Shadmar made but it checks what face the water is on. Just make sure self.Material is the same as the material you've placed on your face.

 

It uses probe reflections so it's very inexpensive when it comes to that.

 

-- Make this the material you used on your face.
Script.Material = ""--path
function Script:Start()
 self.textures = { }
 -- Fetch workshop animated water normals
 for x=0,9,1
 do
		 local name = "water1_"..x..".tex"
		 self.textures[x] = Texture:Load("Materials/Effects/Water/"..name)
 end
 for x=10,63,1
 do
		 local name = "water1_"..x..".tex"
		 self.textures[x] = Texture:Load("Materials/Effects/Water/"..name)
 end
 -- Load material
 self.mat = Material:Load(self.Material)

-- Only apply the water texture to the face where we've assigned it.
if self.entity:GetClassName()=="Brush" then
tolua.cast(self.entity, "Brush")
System:Print(self.entity:GetFace(0):GetMaterial())
if self.entity:GetFace(0):GetMaterial() == self.Material then
self.entity:SetMaterial(self.mat)
end
end
 self.index=0
end
function Script:UpdateWorld()
 -- Animate normals for texture1 for material
 if self.index > 63 then self.index=0 end
 local count = 0
 self.index=self.index+Time:GetSpeed()*0.25
 count=math.floor(self.index)
 if self.mat ~= nil then self.mat:SetTexture(self.textures[count],1) end
end

cheepwater.zip

  • Upvote 4

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

  • 11 months later...

Hey,

Since I can't create pools of water with the leadwerks water solution, I tried to use this asset made by reepblue, idk why but there is no reflections and color in the water in my tests. The animation works fine.

Ip2YsPJ.png

I remember the game Evaluation Abridged by Einlander has a nice water:

tS1XaIv.jpg

Anyone know how I can get the same results?

I really appreciate your help :)

My Leadwerks games!

https://ragingmages.itch.io/

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...