I am working on a water shader in UE4 and I am stuck when it comes to making the waves smaller when they get closer to the coast. The vertex shader in UE4 can't read depth. Do you guys have any idea on how to get this result?
I'm working on a FFT waves model for a water shader too... haven't really got to actually making shores but I was planning on doing it with vertex color masking, with the alpha controlling the parameters for the amplitude and frequency of the waves.
I'm working on a FFT waves model for a water shader too... haven't really got to actually making shores but I was planning on doing it with vertex color masking, with the alpha controlling the parameters for the amplitude and frequency of the waves.
Ah ok! Yes that would work but it's not very generic. I'll consider it!
Thank you for sharing your ideas!
Yes exactly. The vertex shader in UE4 cannot read depth.
That is unfortunate, could have been easier if you had access to DepthFade. My suggestion would then also be to use vertex colors. Not the most "automatic" solution, but it will work and you do have more control than most other solutions.
Going to think on this awhile though, I will let you know if I come up with anything.
That is unfortunate, could have been easier if you had access to DepthFade. My suggestion would then also be to use vertex colors. Not the most "automatic" solution, but it will work and you do have more control than most other solutions.
Going to think on this awhile though, I will let you know if I come up with anything.
Yes I tried the vertex colors out and it worked as expected but a more generic solution which doesn't need the control you speak of is what I was looking for.
Replies
Ah ok! Yes that would work but it's not very generic. I'll consider it!
Thank you for sharing your ideas!
Any other ideas out there?
I don't know how to detect collision with mesh from shader level ;\
Yes exactly. The vertex shader in UE4 cannot read depth.
That is unfortunate, could have been easier if you had access to DepthFade. My suggestion would then also be to use vertex colors. Not the most "automatic" solution, but it will work and you do have more control than most other solutions.
Going to think on this awhile though, I will let you know if I come up with anything.
Yes I tried the vertex colors out and it worked as expected but a more generic solution which doesn't need the control you speak of is what I was looking for.