Ah, it works now! I like it.
Hence, to some degree, my suggestion of 3D noise rather than 2D.
I might have a shot at putting together a quick prototype; I’m not terribly familiar with shaders, however, so I may not get it working. ^^;
To some degree, yes, but I find that they don’t cluster all that often, resulting in the clouds tending to have more or less the same shape.
I messed around with the code a little in order to produce intentional clumping; I’m not sure that it’s an improvement (I’ve seen some occasional flickering that I imagine results from transparency layering issues, for example), but take a look. The changes are as follows (each change should be marked with a comment, although I may have missed some):
# I placed the clouds a little higher in order to be able to better see them
self.cloud_z=30
self.cloud_speed=0.3
cloud_size=5
# Lots of clouds! :D
cloud_count=80
self.clouds=[]
for i in range(cloud_count):
# For each cloud, randomly determine how many parts it has
numClouds = random.randint(1, 7)
# The position of the cloud, copied from your original "setPos" call,
# if I recall correctly; I'm planning on using it more than once
# below, and hence am generating and storing it here.
basePos = Vec3(random.randrange(-self.cloud_x/2, self.cloud_x/2),
random.randrange(-self.cloud_y/2,self.cloud_y/2),
random.randrange(self.cloud_z)+self.cloud_z)
# The more parts a cloud has, the smaller those parts should be,
# in order to prevent multi-part clouds from becoming too large
cloudScale = cloud_size*0.7/numClouds + cloud_size*0.3
# Now, iteratively generate cloud-parts. This is essentially
# the previous cloud-generation code.
for i in xrange(numClouds):
# Generate offset values for scale and position,
# vary the size and place of each part
scaleOffset = random.uniform(-cloudScale*0.4, cloudScale*0.4)
x = random.uniform(cloudScale*0.5, cloudScale*1.2)*random.choice([1, -1])
y = random.uniform(cloudScale*0.5, cloudScale*1.2)*random.choice([1, -1])
z = random.uniform(cloudScale*0.1, cloudScale*0.2)*random.choice([1, -1])
posOffset = Vec3(x, y, z)
self.clouds.append(cloud.copyTo(self.cloud_root))
# Set position and scale, using the offsets
# produced previously, and additionally apply
# a random rotation to further vary the shapes
# produced. I'm not sure of how I feel about
# the rotations, however.
self.clouds[-1].setPos(render,basePos + posOffset)
self.clouds[-1].setR(random.uniform(0, 360))
self.clouds[-1].setScale(cloudScale + scaleOffset+random.random(),
cloudScale + scaleOffset+random.random(),
cloudScale + scaleOffset+random.random())