[ON HOLD] Bumi: Real-Time Day/Night & Weather

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

Enjay wrote:I assumed you were going to do it by having a series of increasingly snowy looking textures (ready made in a graphics program rather than having ZDoom blend them somehow) that you would switch to in turn as the snow was falling. Melting would then be done by running the texture sequence in reverse if the sun comes out/it rains/whatever.

I suppose an extension of the snow building up idea is puddles forming when it rains.

That's what I initially thought too, but that would increase the texture memory a lot because so many new graphics have to be created.

The rain puddles were easy because Sector_SetReflection can be controlled in real-time so it was just a matter of linking the reflection alpha to the precipitation amount. :D

I kind of have another idea, at least for walls: linedefs that are 1 map pixel away from the actual surface which will draw only the snow overlay on top of the regular texture. I guess I can fade those in and out via ACS. Not sure about floors though. 3D floor alpha cannot be controlled during runtime...
User avatar
phantombeta
Posts: 2180
Joined: Thu May 02, 2013 1:27 am
Operating System Version (Optional): Windows 10
Graphics Processor: nVidia with Vulkan support
Location: Brazil

Re: [WIP] Real-time day/night and weather engine

Post by phantombeta »

I have only one thing to say.
Hooooooooooooooooooooooooly fuck, this is awesome!
User avatar
Devianteist
Posts: 945
Joined: Wed Sep 24, 2014 4:07 pm
Location: Creating a SPACE HULK conversion!
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Devianteist »

After watching that absolutely amazing video, I have one question; How are you planning, if you've discovered how, to optimize this for low-end computers?

That would be quite the feat.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

- Make the maths that computes colours faster/more efficient
- Optimize the amount of calculations all over the engine so it demands less CPU cycles (to be honest, my coding style is sloppy and I'm sure there's a lot of places where my coding was done in a lazy-but-gets-the-job-done way... getting rid of as many as these as possible would help a lot)
- Come up with illusions to make raining spawn less actors but still look just as dense
- Figure out a way to render prettier-looking clouds without spawning too many particles (use a sky dome maybe)

These are the most obvious ones I can think of ATM.
User avatar
Ozymandias81
Posts: 2068
Joined: Thu Jul 04, 2013 8:01 am
Graphics Processor: nVidia with Vulkan support
Location: Mount Olympus, Mars
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Ozymandias81 »

OMG!!!! THAT'S AMAAAAAAAAAAAAAAAAAAZING! I NEEEEEED IIIIIIT! :lol:
User avatar
Onar4241
Posts: 296
Joined: Sun Aug 03, 2014 9:41 am
Location: New York

Re: [WIP] Real-time day/night and weather engine

Post by Onar4241 »

Nash wrote:- Make the maths that computes colours faster/more efficient
- Optimize the amount of calculations all over the engine so it demands less CPU cycles (to be honest, my coding style is sloppy and I'm sure there's a lot of places where my coding was done in a lazy-but-gets-the-job-done way... getting rid of as many as these as possible would help a lot)
- Come up with illusions to make raining spawn less actors but still look just as dense
- Figure out a way to render prettier-looking clouds without spawning too many particles (use a sky dome maybe)

These are the most obvious ones I can think of ATM.
To continue:

-Add something like A_CheckSight to rain and snow drops - So they disappear if you're not looking at them.
-Lightning effects to disappear if you're not looking at them.
-Not true color coronas, clouds and sun. Use in-game filters.
-No overlapping on rain and snow drops.

Can't think of anything else at the moment.

Oh, and outstanding work by the way!
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

- the precipitation particles spawn closely around the player so in most cases they will all be within the player's LOS so that won't really help much with performance
- lightning is literally just hiding the clouds for 5 tics (and making the sky a bright white colour), it doesn't drain much performance (if at all)
- lens flare and clouds can already be turned off using CVARs. Turning off the lens flare does not contribute to a better performance, but reducing (or turning off completely) the cloud density CVAR does help with performance. So this one is [Already In]
- I don't understand what this is.

The biggest CPU hog in this engine is currently the maths stuff. Everything else is pretty much standard-fare ACS that people are already commonly doing in their mods...
User avatar
Onar4241
Posts: 296
Joined: Sun Aug 03, 2014 9:41 am
Location: New York

Re: [WIP] Real-time day/night and weather engine

Post by Onar4241 »

Nash wrote:- the precipitation particles spawn closely around the player so in most cases they will all be within the player's LOS so that won't really help much with performance
- lightning is literally just hiding the clouds for 5 tics (and making the sky a bright white colour), it doesn't drain much performance (if at all)
- lens flare and clouds can already be turned off using CVARs. Turning off the lens flare does not contribute to a better performance, but reducing (or turning off completely) the cloud density CVAR does help with performance. So this one is [Already In]
- I don't understand what this is.

The biggest CPU hog in this engine is currently the maths stuff. Everything else is pretty much standard-fare ACS that people are already commonly doing in their mods...
Reply to 3: I'm not saying that you should turn them off. Make them disappear while you're not looking at them using A_CheckSight. Oh, does the sun light up things using GLDEFS? If yes, insert another dummy frame of the sun, but do not apply any light in GLDEFS. That way I rescued lots of FPS in my mod.

Reply to 4: Summon 30-100 actors of the same kind and at the same spot. If you look at them or go closely, your framerate will pretty much go down to around 6-10 FPS. In some cases some actors may spawn right where the other actor of the same kind is, so, add a "DONTOVERLAP" flag just to make sure.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

The sun and clouds are contained inside a skybox and I don't think you can use A_CheckSight in the way you described... it will probably register as "cannot see player" because there's no direct LOS between the objects and the players so the stuff in the sky will forever be invisible. Even if you COULD do this (like if the LOS transfers between the skybox camera and the player, which I highly doubt), it won't work with multiplayer. Also no, the sun has no GLDEFS light attached to it.

The clouds slow down the game because they are rendered as polygons with alpha and being so close to the skybox camera causes overdraw issues (when many clumps of clouds are all within close proximity). The same effect can be observed if you fire 1000 or so rockets or bullets into the same spot on the wall then walk up to it so it's close to you; the game will slow down a lot. Anyway, A_CheckSight won't really help with this problem.

I know of a few ways I can improve performance as far as clouds are concerned:

1) decrease the scale of the cloud actor
2) move the clouds further up in the Z axis (same effect as (1))
3) set sv_clouddensity to a lower value [Already In]
4) combine a reduced cloud density and a skydome model to give the illusion of thicker clouds
User avatar
Onar4241
Posts: 296
Joined: Sun Aug 03, 2014 9:41 am
Location: New York

Re: [WIP] Real-time day/night and weather engine

Post by Onar4241 »

Nash wrote:The sun and clouds are contained inside a skybox and I don't think you can use A_CheckSight in the way you described... it will probably register as "cannot see player" because there's no direct LOS between the objects and the players so the stuff in the sky will forever be invisible. Even if you COULD do this (like if the LOS transfers between the skybox camera and the player, which I highly doubt), it won't work with multiplayer. Also no, the sun has no GLDEFS light attached to it.

The clouds slow down the game because they are rendered as polygons with alpha and being so close to the skybox camera causes overdraw issues (when many clumps of clouds are all within close proximity). The same effect can be observed if you fire 1000 or so rockets or bullets into the same spot on the wall then walk up to it so it's close to you; the game will slow down a lot. Anyway, A_CheckSight won't really help with this problem.

I know of a few ways I can improve performance as far as clouds are concerned:

1) decrease the scale of the cloud actor
2) move the clouds further up in the Z axis (same effect as (1))
3) set sv_clouddensity to a lower value [Already In]
4) combine a reduced cloud density and a skydome model to give the illusion of thicker clouds
In this case you need the "DONTOVERLAP" flag, and a CVAR to set a limit for the clouds would also be ideal.
Blue Shadow
Posts: 5043
Joined: Sun Nov 14, 2010 12:59 am

Re: [WIP] Real-time day/night and weather engine

Post by Blue Shadow »

Nash wrote:The same effect can be observed if you fire 1000 or so rockets or bullets into the same spot on the wall then walk up to it so it's close to you; the game will slow down a lot.
I thought this only happened in the software renderer...
User avatar
Onar4241
Posts: 296
Joined: Sun Aug 03, 2014 9:41 am
Location: New York

Re: [WIP] Real-time day/night and weather engine

Post by Onar4241 »

Blue Shadow wrote:
Nash wrote:The same effect can be observed if you fire 1000 or so rockets or bullets into the same spot on the wall then walk up to it so it's close to you; the game will slow down a lot.
I thought this only happened in the software renderer...
It happens both in software and OpenGL.
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

Blue Shadow wrote: I thought this only happened in the software renderer...
It happens less drastically in OpenGL, but it can. :D This was one of the complaints of my fake volumetric lighting WAD lololol

If I set the cloud density CVAR in this engine to something absurdly high, I get 1 FPS when I look up to the sky.
User avatar
Virtue
Posts: 919
Joined: Sun Nov 19, 2006 8:15 am
Location: Manchester UK

Re: [WIP] Real-time day/night and weather engine

Post by Virtue »

regarding the level used, is that a GTA mod (using GTA2 textures)?
User avatar
Nash
 
 
Posts: 17501
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [WIP] Real-time day/night and weather engine

Post by Nash »

Locked

Return to “Resources”