Jump to content

How can I get the area where two objects intersect?


havenphillip
 Share

Recommended Posts

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.

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

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 ?

 

 

Link to comment
Share on other sites

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/

  • Like 1
Link to comment
Share on other sites

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.

  • Thanks 1
Link to comment
Share on other sites

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???

 

 

Link to comment
Share on other sites

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.

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

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?

 

 

Link to comment
Share on other sites

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

  • Like 2
Link to comment
Share on other sites

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.

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

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