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.

DarkBASIC Professional Discussion / Need a little help with a cloud shader.

Author
Message
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th May 2010 21:00 Edited at: 19th May 2010 21:02
I've decided to play around with converting one of my existing shaders to make clouds on the planets in my game.

Here's what I'm doing so far.

The cloud sphere is slightly larger than the planet, and I use
SET OBJECT TRANSPARENCY obj, 3
SET ALPHA MAPPING ON obj, 30
to make the object transparent enough to see the planet behind it.

I'm using 3 textures for the clouds sphere
Normal map
Color map (256x256 image all 1 solid color)
Alpha map (256 color greyscale image, no alpha channel)

Here is the shader as I have modified it so far,


The resulting clouds are "ok" but I'm not happy with the edges of the clouds. They are to dark, and make the clouds look like things used to in movies where they used Blue Screen effects. (you know, where you could see a little bit of blue around the actors..)

Here's a piece of a screenshot to show what I mean.



Any idea how I can make the clouds all white to help reduce that nasty looking edge?

I tried making the alpha map black and white instead of greyscale, but that didn't help either.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th May 2010 22:06
This bit troubles me:



You seem to be using the alpha map twice - to darken the output colour and also to provide the right alpha level.

Could you supply some typical media so we can have a look? I'm sure it can be fixed simply.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 19th May 2010 22:25 Edited at: 19th May 2010 22:27
As typically happens, the act of writing the question brings to mind other possible answers.

The issue was with my alpha map. The shader is fine.

I'm still getting used to working with the various layers of textures, and I suddenly realized when I hid the alpha mask layer there was a greyscale imprint of the mask on the color layers. I promptly selected the color layer and painted that all white, saved the image to a PNG with alpha layer included this time, and it came out beautifully.



Thanks for checking on it though GG. I appreciate it.

Now I need to do the same for the other 45 cloud layer files.

Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 19th May 2010 23:32
Quote: "I'm still getting used to working with the various layers of textures, and I suddenly realized when I hid the alpha mask layer there was a greyscale imprint of the mask on the color layers."


Yes, that issue has caught me out at times. Some software uses the alpha component to modify the colour component that's displayed so it's hard to see what's going on.

Quote: "Thanks for checking on it though GG. I appreciate it."


You're welcome. Glad the solution was simple.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th May 2010 00:05 Edited at: 20th May 2010 00:05
What I was going for was the ability to specify the color of the clouds on any given planet. Ones with toxic gasses, or just different atmosphere compositions, or high levels of dust or ash, etc..

Just for you, here are some Green clouds. The upper image is with the shader, the lower is using SET BLEND MAPPING ON commands, which I was able to finally wrap my head around some aspects of by examining your demos on the command.



Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 20th May 2010 00:21
Nice Green Clouds. Reminds me of my home planet.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 20th May 2010 01:39
Here are a few more for your viewing pleasure.

Magnus - An uninhabitable planet with a toxic atmosphere.


Galios - A planet whose surface is all liquid methane.


Dakar - A desert planet with little water. Storms pick up dust from the surface and throw it into the upper atmosphere.


Login to post a reply

Server time is: 2026-07-25 16:19:19
Your offset time is: 2026-07-25 16:19:19