Josh Posted July 28, 2020 Share Posted July 28, 2020 It is in the default engine shaders already. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Marcousik Posted July 28, 2020 Share Posted July 28, 2020 2 minutes ago, JMichaelK said: It is in the default engine shaders already. Hä? A wave shader? free to use? Where? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 28, 2020 Share Posted July 28, 2020 Enable water in the scene properties. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Marcousik Posted July 28, 2020 Share Posted July 28, 2020 Yeah sure I know about that... I mean WITH waves ! like this shared link here: Quote http://fire-face.com/personal/water/ Quote Link to comment Share on other sites More sharing options...
Josh Posted July 28, 2020 Share Posted July 28, 2020 No, it doesn't do that. I was just talking about the foam on the edges, which is done in a similar manner to how my shader controls transparency. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Marcousik Posted July 28, 2020 Share Posted July 28, 2020 Okay... Could you add waves or is it that difficult? (Sorry I don't know anything about shaders, maybe I will start study this sometime.) Because it seems to be used in so much games... I'm asking if it is that heavy to add? The noise on the water is generated with normals, am I right? Would it not be simplier with shader noise ? Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 28, 2020 Author Share Posted July 28, 2020 I think if I can figure this thing out I might be able to add foam at least. I do wonder how those big waves are created. Maybe vertex displacement or something. Quote Link to comment Share on other sites More sharing options...
Marcousik Posted July 29, 2020 Share Posted July 29, 2020 I just wanted to try something: Applying effect of leaves shader on the water shader. In a few minute I could get interesting effect. But far from waves: water.shader TEMP 2020-07-29 18-55-38.mp4 2 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted July 29, 2020 Share Posted July 29, 2020 Last stand, I obtained ocean waves by adjusting the movement, could be ok but still no foam. I tried to adjust what I found, but the problem and funny is I have absolutly no idea what I'm objectively doing. Leadwerks Editor 4.6 - J__D-dISK_Documents_Leadwerks_Projects_MainGame_Maps_start.map 2020-07-30 00-03-09.mp4 1 Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 29, 2020 Author Share Posted July 29, 2020 That's awesome, dude. That's how it goes for me. Just keep hacking it until you get something. The more time you spend changing numbers and values the more you understand it. Some resources you could investigate. Tons of shaders here. Flipping them over to Leadwerks isn't that hard: https://shaderfrog.com/app/ https://www.shadertoy.com/ 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted July 29, 2020 Share Posted July 29, 2020 Yes it s fascinating. I wonder if the waves could become more than a skin, should actually be transformed in a physics force on swimming objects, if this is possible with a shader...??? Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 30, 2020 Author Share Posted July 30, 2020 Yeah that would be cool. I've seen ripple shaders and footprint shaders. The problem, I would think, is how to pick up the footsteps or raindrops. Quote Link to comment Share on other sites More sharing options...
gamecreator Posted July 30, 2020 Share Posted July 30, 2020 2 hours ago, havenphillip said: Tons of shaders here. Flipping them over to Leadwerks isn't that hard: https://shaderfrog.com/app/ https://www.shadertoy.com/ It would be great to have a simple tutorial or walkthrough for this process as I know nothing about shaders but I'm pretty comfortable learning by modifying. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 30, 2020 Author Share Posted July 30, 2020 No problem. But give me about a day. I'm the same way. Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 30, 2020 Author Share Posted July 30, 2020 6 hours ago, gamecreator said: It would be great to have a simple tutorial or walkthrough for this process as I know nothing about shaders but I'm pretty comfortable learning by modifying. Alright bro I put it up. Didn't take as long as I thought. It's in Technical Assistance. If there's a specific shader you're eyeballin' I'll make a walkthrough of it. 1 Quote Link to comment Share on other sites More sharing options...
gamecreator Posted July 30, 2020 Share Posted July 30, 2020 Whoa! Thank you! I'm gonna read through it. I don't have a specific one in mind but this opens up a lot of possibilities, if it's as straightforward as it seems. Josh moved it to the programming forum but here's the link: Thanks again! 1 Quote Link to comment Share on other sites More sharing options...
Marcousik Posted July 30, 2020 Share Posted July 30, 2020 To come back to the titel question, "How can I get the area where two objects intersect?" Does anybody knows anything about communication between shader and script variables? For example: the water level is now moving because the waves; until now I checked in script the position.y of the player to determine if we nead to hear a splash sound as foot step instead of the common footstep sound. But now seems difficult because the water is not constant anymore. Any idea on this??? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 30, 2020 Share Posted July 30, 2020 20 minutes ago, Marcousik said: To come back to the titel question, "How can I get the area where two objects intersect?" Does anybody knows anything about communication between shader and script variables? For example: the water level is now moving because the waves; until now I checked in script the position.y of the player to determine if we nead to hear a splash sound as foot step instead of the common footstep sound. But now seems difficult because the water is not constant anymore. Any idea on this??? Send your information one way from the CPU to the shaders. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Marcousik Posted July 30, 2020 Share Posted July 30, 2020 32 minutes ago, JMichaelK said: Send your information one way from the CPU to the shaders. Äh thx Josh but I'm novice at this, can you explain what exactly you mean? Actually I require informations from the shader to the script to determine the water level of the waves or am I wrong? Quote Link to comment Share on other sites More sharing options...
havenphillip Posted July 30, 2020 Author Share Posted July 30, 2020 3 hours ago, Marcousik said: Äh thx Josh but I'm novice at this, can you explain what exactly you mean? Actually I require informations from the shader to the script to determine the water level of the waves or am I wrong? Here's an old Shadmar water that shows how you can manipulate a shader in lua: Create a large plane to be your water plane Attach the water.lua to the plane Drag and drop whatever your player or camera is into the "player or camera" slot apply the normals in the normals slot (you might have to manipulate the normals to get the right size It will show up when you run your game but not otherwise. But it shows how you can use lua to affect the shader Edit: Some other examples of this are in the HUD Elements in the Leadwerks workshop. Actually quite a bit but they're all post-render things. The pattern is there, though. shadmar water.zip 2 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 31, 2020 Share Posted July 31, 2020 In the new engine, special water shaders will only require you morph the vertex positions and surface normal and color, because the raytracing system already handles reflection on everything, so it can just use that without requiring any specialized code. There's also refraction on all transparent surfaces, so you can just use that. Water used to be a highly specialized system but now all surfaces are being drawn with the same properties. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
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.