Jump to content

Rend2 - A Modern Renderer


Xycaleth

Recommended Posts

  • 4 weeks later...

So... I had the misfortune and fortune of having a full weekend where I could just work on rend2 the whole time. It's unfortunate because this only came about because I'm ill. Fortunate because I've been able to get somewhere with adding weather :P

 

Here's what I have so far:

 

All I'm missing now is to stop it raining indoors and underneath things, and to make it a bit more customisable so that it can do other weather effects. I also need to actually spawn rain around the camera, instead of covering the entire map. When I get around to doing any of that, who knows :)

 

So, the fun thing about this rain, is that there are around 250k rain drops, with very little performance impact. It even runs well on my MacBook Air which isn't the most powerful thing in the world :)

Link to comment

that would be cool too. But I was referring to an EFX or something to make the droplet impact effect.

 

Warzone weather system uses efx files. It's not a glsl system though, it creates the weather in cgame, but its very customizable. I decided that trying to do it with glsl just wasnt worth the effort of working out indoor/outdoor, it was simple in cgame. It could do splashes easilly (actually it originally did), but i disabled the splashes because they require traces for the ground surface for each particle. GLSL could do it faster, but im not sure how xycaleth is going to handle the indoor/outdoor and collision checking that late in the frame.

z3filus likes this
Link to comment

but im not sure how xycaleth is going to handle the indoor/outdoor and collision checking that late in the frame.

I was planning to use the same principle as a shadow map. At the start of the map I'll render a birds eye view of the entire map depth into a texture (or multiple). Then each rain drop can check against this depth map to see if it should be drawn or not.

 

Can also use this to randomly place rain drop effects.

Link to comment

I was planning to use the same principle as a shadow map. At the start of the map I'll render a birds eye view of the entire map depth into a texture (or multiple).

I would've also used a "shadow map", though it could be rendered in realtime to allow dynamic objects to stop rain and to account for changing wind.
Smoo and Archangel35757 like this
Link to comment

So... I had the misfortune and fortune of having a full weekend where I could just work on rend2 the whole time. It's unfortunate because this only came about because I'm ill. Fortunate because I've been able to get somewhere with adding weather :P

 

Here's what I have so far:

 

All I'm missing now is to stop it raining indoors and underneath things, and to make it a bit more customisable so that it can do other weather effects. I also need to actually spawn rain around the camera, instead of covering the entire map. When I get around to doing any of that, who knows :)

 

So, the fun thing about this rain, is that there are around 250k rain drops, with very little performance impact. It even runs well on my MacBook Air which isn't the most powerful thing in the world :)

That is so cool :P

AngelModder likes this
Link to comment

I was planning to use the same principle as a shadow map. At the start of the map I'll render a birds eye view of the entire map depth into a texture (or multiple). Then each rain drop can check against this depth map to see if it should be drawn or not.

 

Can also use this to randomly place rain drop effects.

 

I foresee issues with using depth maps, you might be better off using a modified version of this code i made to generate heightmaps for wz.

 

https://github.com/Stoiss/Rend2/blob/rend2/codemp/rd-warzone/tr_mapping.cpp#L747

 

Then you can use material types to work out stuff like water hits, etc, and it makes it a bit easier to skip translucent objects and stuff. You simply have more info to make use of via traces.

 

That would give you a map of surface positions for each map point using a single image (the other 3 colors in the texture could be used for material and 2 other useful position infos). A heightmap can be useful for other stuff too. You are also however going to need a positionmap for the screen, but thats a good thing, its a start to moving rend2 to deferred to get that FPS up on detailed maps.

Link to comment

You can derive surface positions from the depth map. Water drops aren't going to be (and don't need to be) pixel perfect. You can randomly place them and they will look completely natural.

 

I guess, as long as you use very small splashes or make them fully procedural and 3D. You don't want a 2D splash hitting the top of a signpost and creating a big flat splash, it would look unnatural.

 

One advantage of traces is you can skip past small objects easily. Anyway I just thought I would point out that I already made a system for mapping surfaces of the map to images for whatever needs (which I currently am not using for anything myself).

 

How is the FPS of the rain when you add alpha channel textures for them?

 

Also, I wonder if (instead of static shaders or glsl procedural effects) the raindrops and splashes would be best done by pre-recording efx system scripts at map start (into animated image maps), which may not look as good, but would probably be good for JKA modders and make the whole system very easy to customize. I guess another option is to allow loading custom glsl files for the system, which is a better option, but requires modders to learn new stuff. The only other option is preset weather systems, which is pretty limiting.

Link to comment

Would FPS take a hit if you used an .EFX file for the rain drops? Because you can set another .EFX to play from within the current .EFX file when the effect is "killed". Would be useful for making splashes, and you can also distance cull within the .EFX file as well.

Link to comment

Would FPS take a hit if you used an .EFX file for the rain drops? Because you can set another .EFX to play from within the current .EFX file when the effect is "killed". Would be useful for making splashes, and you can also distance cull within the .EFX file as well.

 

Big time.

Link to comment
  • 3 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...