Jump to content

Cloud procedural texture alpha


Recommended Posts

Hello everybody !


I have a little probleme about cloud procedural texture,

I wanna some transparency on my cloud.


The doc say :

  • CloudProceduralTexture
    • skyColor is the color for the sky (BABYLON.Color3/4)
    • cloudColor is the color for the cloud (BABYLON.Color3/4)

But BABYLON.Color4 seems to not be support...


A demonstration :


Link to comment
Share on other sites



I see the patio, through the sphere's alpha, now.  I assigned the texture as an opacityTexture in line 155... seems to work.  I also adjusted the texture level, reduced the sphere size, and changed the camera position, for testing purposes.


Panning the camera up/down shows a strange jaggy line passing across the cloud sphere (FF 39).  I'm not sure what is causing that.  Be well.


Update: It was the directionalLight that was causing the horizontal jaggy line.  http://www.babylonjs-playground.com/#24C4KC#10

(I turned-off the directional and turned-on a no-ground-color hemisphericLight - aimed at the sky... cuz that's how they work best.)


Just in case it is important,  DirectionalLights have no .groundColor... that's for hemisphericLights only.  But that might have been a mistake that was already in the demo... before you started.  :)


A nice groundColor setting for a hemi light... is our pre-made Gray() color.




(line 106).  It lights the bottom of mesh real nicely.  Notice that the line doesn't require 'new'.  We know all this already, don't we?  Good ol' Wingnut, yappin' away.  :)

Link to comment
Share on other sites

Cool, you guys.  Hey Irbix... are you planning having 2 cloud spheres... one for high clouds, one for low (a little sphere inside a bigger one)?  Do you want to see the high clouds through the gaps in the low clouds?  That would be interesting.  Rotate them at slightly different speeds?  Yum... maybe.  :)

Link to comment
Share on other sites

http://www.babylonjs-playground.com/#24C4KC#14  Weird.  The only shape that can be seen through jahow's transparent clouds... is the fire-textured sphere (fontainSculptur2 - line 41 - I made it bigger), and the angle of viewing it, matters (I sped-up that camera pan).  It sometimes disappears.  *scratch scratch*  I'm scared.  :o  I have a 'frontside' on line 149.


Using the fire proc texture on the cloud sphere... things act better.




If I remember right, there is a thread nearby that talked about Fire's alpha, and I think Dad72 and Meulta had some cool discussions, which led to some tweaks.  Maybe the same tweaks need to happen to our cloud proc.  *shrug*

Link to comment
Share on other sites

Damn, Jahow just wedges a shader store right onboard and hacks the hell out of it.  Too cool!  You're hot hot hot, Jahow.  I'm glad you're hanging around with us!  Took ya what?  17 seconds?  phew!   Excellent!


And thanks for the mini-tut on alpha blending!  I hear of these things, but its excellent when you Gods point them out, in day-to-day issues.  Thanks!!


Did you see the PG errors?  I can't get it to display, now... PG error reports are intermittent in my browser.... but it said for lines 157, 158, 160, 161... cannot assign color4 to color3... no .toColor4() found on Color3.


That will probably correct itself after the AR.  (accepted request?) 


Typescript is typecasting upon us, me thinks.  Intellisenselessness.   Smart editors... pft.  Sometimes they get a little head-strong and think they know more than we do.  ;)

Link to comment
Share on other sites

Yep, Typescript is playing against us here. But the wonderful thing about JS and TS is that, although you're warned that there is an inconsistency, you can just ignore it and keep hacking stuff all day.


Also I became proficient in PG hacks because I'm just too lazy to reproduce the issue on my computer, fix it, check that everything works and then commit the fix.  :ph34r:

Link to comment
Share on other sites

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.

Reply to this topic...

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


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...