Jump to content
  • 0
havenphillip

How can I get the area where two objects intersect?

Question

45 answers to this question

Recommended Posts

  • 0
2 minutes ago, JMichaelK said:

It is in the default engine shaders already.

Hä? A wave shader? free to use? Where?

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0

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 ?

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0
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

Share this post


Link to post
  • 0

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!

  • Like 1

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0
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.

Share this post


Link to post
  • 0
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?

Share this post


Link to post
  • 0
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

Share this post


Link to post
  • 0

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

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