Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Trying to create a water foam effect with perlin noise - abrupt removal of color

Author
Message
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Oct 2018 03:58 Edited at: 17th Oct 2018 22:16
I get a nice interpolation of color at the beginning, but then at the end I get an abrupt change of color.

Just curious if anyone can help me figure out how to fade at the end of the cycle instead of an abrupt change. Thanks.

The noise and random are from BookofShaders.com
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 17th Oct 2018 11:24
Only thing I can think of is the color value may be falling outside of the allowable range and jumping to a supported color value. But I'm far from a shader expert.
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
puzzler2018
User Banned
Posted: 17th Oct 2018 12:35
That makes sense - so maybe use clamp to make values go between 0.00 and 1.00 and like Phealax states im no shader expert either, just throwing something in..
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Oct 2018 22:04 Edited at: 17th Oct 2018 22:16
Color value is already clamped to .75-1.0 which when converted to RGB via vec3(n) is an off white to a very white. Going below .75 starts to produce a gray/black color. Although, perhaps not going all the way to 1.0 may help with the transition. I'll have to test that out.

float n = clamp(noise(posn),.75,1.0); // this is then used for the 3 RGB colors vec3(n)


Currently where I am at, but not really what I want. Would love to see random foam seperate like its floating on its own.
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 17th Oct 2018 22:13
Sorry, also wanted to ask if android can make depth maps? I thought I read it couldn't, but when I googled it I came up with no answers.
puzzler2018
User Banned
Posted: 17th Oct 2018 22:18
good man, let us let know it goes
Golelorn
7
Years of Service
User Offline
Joined: 20th Nov 2016
Location:
Posted: 18th Oct 2018 03:38
I ended up converting Janbo's foam portion of his ocean shader. Same FPS and better results. My FPS is all over the place. I get 78-110fps with a low-end Nvidia laptop. I am not using a heightmap. I am going to test that tomorrow to see if I can get better FPS.

Obviously, can't post the code. If Janbo doesn't want this up, I will delete the video. But hopefully, this shows how much value comes from his pack.

Login to post a reply

Server time is: 2024-04-25 22:04:01
Your offset time is: 2024-04-25 22:04:01