Dynamic Surroundings

Dynamic Surroundings

51M Downloads

[Enhancement] Rain puddles and rainbows

Sunconure11 opened this issue ยท 4 comments

commented

Would it be possible to add puddles of water that appear during storms, and slowly dissipate as the rain ends? Puddle size could be determined by the intensity of the storm.

Also, what about rainbows? Randomized chance of them appearing after a storm, or rarely, during a sunny day.

commented

Puddles would be difficult. Seems to me they would be some sort of special water block that forms as it rains and decays when it stops raining.

Rainbows I have looked at off and on. I have to understand the physics of those guys a bit more and figure out a good way to render. If it is something I can figure out I plan on adding.

commented

If it helps, here's a simple set of rules for rainbows:

  • Rainbows appear when the sun breaks through rain clouds (so just after rain in-game, fading after a set time or when the sun goes down or reaches noon; whichever comes first)
  • They are actually circles with their center opposite the sun
  • Their radius is ~a quarter of the visible sky (I guess you could just use a fixed size, or make it relative to the FOV if you want to do it fancy)
  • They wouldn't show up in dry biomes.

I'd also not show them if the sun is low in the sky to prevent them being to high up. The main problem I see will be accounting for the altitude of the player. There is more to them IRL, but I don't think that would add much to the game. I hope this simplifies rainbows for you?

commented

What I have found out, and it is pretty simple conceptually, is:

  • Make a line from the sun down through your head. For Minecraft this is the simple solar angle.
  • Turn your back to the sun.
  • Look up 42 degrees from that line you created.
  • Assuming there is enough water vapor in the air a rainbow should be seen.
  • The rainbow is a base of a cone that is formed with the "look" line as the centerline projected out to where the water vapor is located.
  • If it is a double rainbow the secondary rainbow is 51 degrees above that sun/head line.

As a result a rainbow is more likely to be seen early in the AM or late in the PM if there is water vapor. It will not be visible if it where something like high noon.

commented

Yes, that is correct, those 42 degrees are the 'quarter sky' I mentioned, so it is not the center of the rainbow but the arc (unless I misunderstood you). I also think the location of the water vapour is irrelevant (code wise) since Steve is located at the center of the world, so the line sun-Steve-rainbow is simplest and accurate enough. And you are right, the best rainbows can be seen when the sun is -sort of- in parrallel with the ground so to speak.