Jump to content

Rend2 - A Modern Renderer


Xycaleth

Recommended Posts

Posted

I've diverged from the ioq3 code base slightly so not all their changes are applicable. The PBR cvar could be ported but it's mainly a simplification of what was already available. Instead of having multiple cvars to enable pbr, they've been consolidated into one.

minilogoguy18 and Smoo like this
  • 4 weeks later...
Posted

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 :)

Jolly, Stoiss, Sentra and 11 others like this
Posted

I can't tell, but adding a shader/thing to the ground like this would be neat (probably what minilogoguy18 meant).

 

Also this, as a reference  (splashes on the monitor when the view is directed at the sky):

JKG Developer

Posted

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
Posted

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.

z3filus, SomaZ, Tempust85 and 1 other like this
Posted

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.
Archangel35757 and Smoo like this
Posted

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
Posted

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.

Posted

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.

Posted

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.

Posted

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

All the rain drops in that video have an alpha of 0.4 so they're already being alpha blended. There's almost no perceivable fps drop :D

Posted

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.

Posted

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.

  • 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...