I try to generate a clouds texture with a Perlin Noise. I used HeightGenerator for it:
private Texture generateClouds(int width, int height) {
BufferedImage buf = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR);
WaterHeightGenerator gen = new WaterHeightGenerator();
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
double hval = gen.getHeight(x, y, 1);
buf.setRGB(x, y, (int) (hval*255*255*255));
}
}
What am I missing? :? I just try to generate a grayscale noise image. After that I want to add it layered to a large texture that is then projected on a plane above my terrain, maybe with the edges moved down to have a real sky effect.
What I'm heading for is a procedural sky with generated clouds on it. I read about the theory here:
I added the SkyDome and a FogState now and I wondered if it is possible to render a texture on it. I’d love to have some rendered clouds on it. Any ideas or code available?
Hm, I recognized that the far clipping pane cuts my terrain on the horizon. I tried to set the fog density to 1f, but I only apply the fog to the terrain and the water, so that has no effect on the clipping effect of the terrain. I wondered if there is the chance to avoid that "cutting away".
I read about adding mountains to the horizon so a User can't see the clipping. Don't know if this is the only option, but I thought more like the fog is blending out the far edge and after the fog reaches full density, the clipping could take place. Hm, was that clear enough? :?
Having it on the water and terrain should be exactly right… Try using a fog color that very closely matches the average sky color, and set the start and end value up so that they either straddle or end at your far plane (eg: if your far plane was 1000, start and end could be something like 500, 1250) Also, try using linear density.
But the SkyDome is behind the Fog then too, isn't it? Or can I use the ZBuffer to always draw the SkyDome without affecting him with the FogState? Hm, I have to try that later… thanks for your hints.