Jump to content
  • entries
    940
  • comments
    5,894
  • views
    863,951

Water beta now available


Josh

7,454 views

 Share

An update is now available on the beta branch which adds water. This can be controlled in the scene properties or in code with the following commands:

World::SetWaterMode(bool mode)
World::SetWaterHeight(float height)
World::SetWaterColor(float r, float g, float b, float a)
bool World::GetWaterMode()
float World::GetWaterHeight()
Vec4 World::GetWaterColor()

 

You must update your project to get new EXEs and shaders. All model shaders have been modified to handle the slice plane used when rendering reflections. A new set of textures have also been added in "Materials\Effects\Water" to handle the surface perturbation.

 

Caveats / Notes

  • When underwater, no post-processing screen wobble or fog is applied like in Leadwerks 2. This is because Leadwerks 3 has a customizable post-process stack, so the end user can control this.
  • The water physics are not 100% done and behave oddly.
  • There is a bug where switching projects does not reset the water settings to the default.
  • At this time there are no water quality settings, though the renderer uses the lowest possible quality in the reflection pass.
  • This build has been tested on every hardware / OS configuration except AMD on Linux.

 

blogentry-1-0-71302300-1422389282_thumb.jpg

  • Upvote 8
 Share

29 Comments


Recommended Comments



Looking nice, things i noticed on my indoor level which I tested it on.

 

Anything with Trigger collision disappeared.

 

I couldnt see the water when I ran my demo unless I had added a new light or altererd a light setting of a current light.

 

I have a camera parented to my player through the editor, when I turned the reflections turned with me. So if I turned 90 or 180 and walked I could still see the same reflections but getting further away.

Link to comment

Looks great. Tested with the terrain scene- in debug mode everything is fine. In release terrain and skybox are missing, only the water plane is visible (project was updated). The alpha colour value does not change the transparency (should it?).

 

[update] In release everything is black only if the water is visible, as soon as the water plane is culled away visuals are back to normal.

Link to comment

Cant for the life of me figure out how to add the water to a project - have a water shader and a whole pile of water normal maps.

Link to comment

Anything with Trigger collision still disappears.

Camera reflection issue is till there.

Also colours get altererd from lights as in this clip, ignore the red on the columns.

Link to comment

Weird things are happening. . . . My scene is totally black until i turn on the FPS (F11) counter. Then i can see the water and it looks good from a distance but when getting closer to trees that have roots below thew terrain, they are shadowed into the scene above the water plane. :/ Isnt there a way to not have just one huge plane? Like adding the shader to a CSG to make lakes, ponds and such?

 

 

  • Upvote 1
Link to comment

I will need your project to debug this further tomorrow.

 

From what I see above it appears you do not have the new modified shaders but I can't be sure yet.

Link to comment

I am in the beta (because I can't revert to the default branch) and after this update my terrain textures look extremely blurry and my fps dropped from 30 to 10. I am not using the water so something else in this update has caused my performance to drop immensely.

Also if the water worked by attaching a water shader to CSG it would be much more useful; the current system is only useful for oceans/groundwater.

 

--edit It seems there is a new terrain_lowres.shader that is being used for whatever reason, I am guessing that is the cause of my issues. What is that shader for?

Link to comment

Do you want a published version or the entire project or maybe just the shaders that were installed? Im sure you recall that Im the Dumb Dumb that cant keep a clean project folder :) so its probably pretty large. Uploading it to my drop box shouldn't be an issue but will take some time if thats what you want. Tonight, when I first opened the editor, there was an update, then I seen your post about fixing something while I was looking at the command reference in an attempt to learn something new and decided to relaunch the editor and another update was downloaded. If I recall correctly, somethign like 192 files were updated :/

Link to comment

I get an EXCEPTION_ACCESS_VIOLATION followed by a crash when I check Water Mode. I get this message as well when I boot up Leadwerks (not a new problem though), but it doesn't crash then. I'll look into it a little more later.

Link to comment

Crashes for me.. the latest beta downloaded, and I updated my project and received a message about 144 files being updated.. I turned on water, in the scene tab, and immediate segmentation fault.

 

I restarted, tried setting a level > 0.0 to see if somehow that was an issue, and could see the water in the editor viewport, but when i run the game, no water is displayed.

 

When i saved the scene with water on, and restarted Leadwerks, immediate segfault.

 

So yeah, not working so well for me either at the moment....

 

More Info:

 

When I run my standalone application binary in the Project Folder, I do see water and everything seems to work OK (which is cool), however my scene now immediately crashes the Leadwerks editor on load, and launching the game from the editor did not show the water (before the crash-on-load made it impossible to get that far)

 

 

 

and More Info:

 

When i started with a blank scene (by commenting out the current project line in Leadwerks.cfg), and created a new scene with just the water, a box and a camera, everything worked. When i subsequently loaded my main map (which crashed before) it worked.

 

When i quit Leadwerks and restarted, it crashed. So something is not being initialised correctly when a map that contains water is loaded, but it is correctly initialised when an empty map is loaded and water is added.

 

Running the executable directly works fine.

 

Also, water screenshot in the Showcase section - it is looking pretty damn good ! Nice work Josh.

Link to comment

I have same problem as Imchasinyou - scene is all black (except under water) until I press F11 to show fps. This is on a new blank map with just terrain and player.

 

Setting water mode to false and it seems to display ok again except without the water of course.

 

https://www.dropbox.com/s/qn8k42d8v5r9wyt/waterbug.jpg?dl=0

 

Edit: also tested with no terrain and just one box instead to stand on - same problem.

Link to comment
At this time there are no water quality settings, though the renderer uses the lowest possible quality in the reflection pass.

 

Perhaps like :

World::SetWaterQuality(int levelQuality)

0 - sky only reflected

1 - sky and terrain

2 - all around

 

LE3 is getting water happy.png

Link to comment

SetWaterQuality(int levelQuality) should set the reflection resolution instead. Current reflections are a bit too low and stick out of the rest.

Link to comment

SetWaterQuality(int levelQuality) should set the reflection resolution instead. Current reflections are a bit too low and stick out of the rest.

 

Just do a quick blur - water reflections aren't meant to be razer sharp anyway

Link to comment
SetWaterQuality(int levelQuality) should set the reflection resolution instead. Current reflections are a bit too low and stick out of the rest.

Perhaps, but we need a function to control what we want to reflect like in game options.

Link to comment

Just do a quick blur - water reflections aren't meant to be razer sharp anyway

 

That's the opposite of what I want. There should be controls of how detailed the water plane is, just like in any other game. And I agree with YG control over whats reflected could be nice as well. With sharp reflections we can turn water into ice (by putting a transparent CSG over the water to stop buyouncy). Insta-ice. smile.png

 

06480624F7DC2E9CE5E9E7B9026F651B1600EDEB

Link to comment

In the clip I showed above the colours correct themselves when I press F11.

 

Also Bult a new map, if you attach a camera to a pivot that is when the water reflections go wrong. Can upload the map on that one if needed, but its a simple one to replicate.

Link to comment

I have same problem as Imchasinyou - scene is all black (except under water) until I press F11 to show fps. This is on a new blank map with just terrain and player.

 

Setting water mode to false and it seems to display ok again except without the water of course.

 

https://www.dropbox.com/s/qn8k42d8v5r9wyt/waterbug.jpg?dl=0

 

Edit: also tested with no terrain and just one box instead to stand on - same problem.

 

Quick workaround:

In App.lua add after self.world:Render()

 

self.context:SetColor(1,1,1,1)

  • Upvote 1
Link to comment
That's the opposite of what I want. There should be controls of how detailed the water plane is, just like in any other game. And I agree with YG control over whats reflected could be nice as well. With sharp reflections we can turn water into ice (by putting a transparent CSG over the water to stop buyouncy). Insta-ice. smile.png06480624F7DC2E9CE5E9E7B9026F651B1600EDEB

 

While that looks lovely real ice looks noting like that - it is in fact a very uneven surface with lots of scattering ;)

Link to comment

Guest
Add a comment...

×   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.

×
×
  • Create New...