max123 Posted June 15, 2017 Share Posted June 15, 2017 Hi, I'm trying to reproduce ocean shader like this one: https://jbouny.github.io/fft-ocean/#day I know we have waterMaterial in Babylon (which is gorgeous!) but not quite what I'm after: it only works with windForce/windDirection which looks like you're constantly moving or as if water is constantly flowing. I've tried to use shader which you can find at https://github.com/jbouny/fft-ocean but it's just waaaay over my head! First of all, I can't figure out how to split it into vertex/fragment shaders to use in Babylon. Any shader/GLSL gurus out there, any help hugely appreciated! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 15, 2017 Share Posted June 15, 2017 Perhaps @Luaacro could help if he has some free cycles. I know he loves shaders like this one julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
meteoritool Posted June 15, 2017 Share Posted June 15, 2017 yeah the water is amazing on this one ! the sorta fog too ! Quote Link to comment Share on other sites More sharing options...
Milton Posted June 15, 2017 Share Posted June 15, 2017 I think I prefer this one. And the original. Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 @Deltakosh sure! I cannot see the whole effect on mobile so I'll test on PC max123 1 Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 2 minutes ago, Luaacro said: @Deltakosh sure! I cannot see the whole effect on mobile so I'll test on PC Awesome!! Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 12 hours ago, Milton said: I think I prefer this one. And the original. Looks amazing, but rather laggy. If I'm not mistaken, the shader doesn't use bump/normal maps; it's pure math. julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 16, 2017 Share Posted June 16, 2017 @max123 it is, and it's also a post-process, not a material you can apply on a mesh I'll test the shader this afternoon ! max123 1 Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 5 minutes ago, Luaacro said: @max123 it is, and it's also a post-process, not a material you can apply on a mesh I'll test the shader this afternoon ! Thanks! Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 I was trying to use Babylon CYOS to copy-paste from https://github.com/jbouny/fft-ocean/blob/master/js/shaders/FFTOceanShader.js But it's using 7(!) shaders and then the main shader to achieve the effect... Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 i work on optimized version that is to heavy for game Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 28 minutes ago, NasimiAsl said: i work on optimized version that is to heavy for game Would love to see the result Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 16, 2017 Share Posted June 16, 2017 Task is beginning http://www.babylonjs-playground.com/#DU61I8#8 try find wave correct formula Dad72, meteoritool, adam and 1 other 4 Quote Link to comment Share on other sites More sharing options...
max123 Posted June 16, 2017 Author Share Posted June 16, 2017 4 hours ago, NasimiAsl said: Task is beginning http://www.babylonjs-playground.com/#DU61I8#8 try find wave correct formula Dude, this looks great! I'd say if you add some x/z movement, it would make a perfect shader for a brook or a fast river as it is and should become part of bjs custom shaders! For ocean/sea algorithm, try searching FFT (Fast Fourier Transorm). Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 17, 2017 Share Posted June 17, 2017 http://www.babylonjs-playground.com/#DU61I8#10 after complete optimization we can attach any height map algorithm to this Raggar, adam, max123 and 1 other 4 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted June 19, 2017 Share Posted June 19, 2017 This is really good! NasimiAsl 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 19, 2017 Share Posted June 19, 2017 @NasimiAsl you are on! Regarding FFT, it's complex to implement, really interesting, I'm on it right now too Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 19, 2017 Share Posted June 19, 2017 i think Full FFT is so heavy for general so maybe we need some changes maybe we need make too version some full quality and some usable shader and i don't work on height map algorithm now just i wanna find solution for have 60 fps if you can make shader function ( vec3 and time and calculate height ) that can be help too Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted June 20, 2017 Share Posted June 20, 2017 The perlin noise procedural texture may be solution or a good base (available in procedural textures library) Quote Link to comment Share on other sites More sharing options...
max123 Posted June 21, 2017 Author Share Posted June 21, 2017 I think we're getting there! Quote Link to comment Share on other sites More sharing options...
max123 Posted June 21, 2017 Author Share Posted June 21, 2017 Maybe this video can help: julien-moreau 1 Quote Link to comment Share on other sites More sharing options...
max123 Posted October 5, 2017 Author Share Posted October 5, 2017 Bump. Was wondering if you guys had any luck with a good ocean/waves shader. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted October 6, 2017 Share Posted October 6, 2017 I think that @Luaacro is working on it Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted October 10, 2017 Share Posted October 10, 2017 Yes I am! just takes so much time to understand everything and have something robuts Quote Link to comment Share on other sites More sharing options...
max123 Posted October 12, 2017 Author Share Posted October 12, 2017 On 10/10/2017 at 11:21 AM, Luaacro said: Yes I am! just takes so much time to understand everything and have something robuts Well do keep us updated - this would make a great addition to Babylon's Shader library! Quote 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.