โ€บ

Volumetrics Plugin for Godot 3.2! (Coming soon)

SIsilicon28SIsilicon28 Posts: 703Moderator
edited March 14 in Resources

Hello guys! I'm here with some news. I am currently developing another plugin in hopes to help others with their games' visual quality. The volumetrics plugin is based on how frostbite approaches volumetric fog. When it's done you will be able to have more realistic fog that can even react to the scene lights. It also allows you to have local volumes, and even smoke.

Right now, it is usable, but lacks real lighting features. The lighting aboveis hardcoded, but eventually it will work for any light adding the scene.
https://github.com/SIsilicon/Godot-Volumetrics-Plugin

In the meantime you may try my other plugins. ;)
https://github.com/SIsilicon/Godot-God-Rays-Plugin
https://github.com/SIsilicon/Godot-Lens-Flare-Plugin
https://github.com/SIsilicon/Godot-Planar-Reflection-Plugin


Tags :
ยซ1

Comments

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 17

    Hey guys! Progress update! I've added quite a bit to this renderer. Here's what's new.

    • Lights can now be arbitrarily added to the scene. They're no longer hardcoded.
    • All three types of lights are supported (Omni, Spot, Directional {Not in image above}).
    • Anisotropy is supported. It's what determines how much light scatters towards the viewer.
    • Emission is supported too.
    • One and only one volume sprite can be defined as global volume.
    • Volumetric Shadows is available; it's only shadows caused by other volumes in view.
  • CalinouCalinou Posts: 409Admin Godot Developer

    This is looking great, keep up the good work :)

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 24

    @Calinou said:
    This is looking great, keep up the good work :)

    Thank you very much! <3

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 26

    Good evening! After some more time, I have pushed some more updates to the repo. Here's what happened.

    • Omni and Spot lights now have shadow support! :D Directional lights will come later.
    • The setting for volume rendering are now inside of a new VolumetricFog node. This should also allow for multiple viewports to have there own volumetrics effect, but I haven't tested that yet.
    • Ambient lighting is added along with the previous note.
    • Lights can have a volumetric_energy multiplier to strengthen or weaken their volumetric effect.

    This plugin is almost ready for release. I'm so excited! :D This is going to be a huge step from my previous volume addon. I'm thinking of making a video for showing off the addon, but I don't have much a gpu to do so. It get's pretty laggy and I wouldn't want it to show off as being slow for actual gaming PCs.

  • TwistedTwiglegTwistedTwigleg Posts: 2,627Admin

    Looks awesome @SIsilicon28! ๐Ÿ‘

    I'd offer to help showcase the addon, but my GPU is probably to weak to be of much assistance. (Nvidia 660 TI, 2GB). Definitely looks great and I am looking forward to seeing the release!

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 26

    Looks awesome @SIsilicon28! ๐Ÿ‘
    I'd offer to help showcase the addon, but my GPU is probably to weak to be of much assistance. (Nvidia 660 TI, 2GB).

    Well my GPU is an Intel HD Graphics 4400 (an integrated GPU) so you might have a better chance than me.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    @TwistedTwigleg said:
    Definitely looks great and I am looking forward to seeing the release!

    And thank you! :)

  • MegalomaniakMegalomaniak Posts: 2,605Admin

    I've an RX 470 8gb, a mid tier gpu of a couple of generations back. Nothing too special but should be able to handle at least something. What do you need?

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    Just a demonstration of the plugin. Nothing special. I'd like to show off it's settings in a demo. If you'd like to assist, I'll let you know when I'm ready. :)

  • MegalomaniakMegalomaniak Posts: 2,605Admin

    Sure, just let me know. Will have to install OBS again I guess.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    Thanks for the offer! Will do. :D

  • CalinouCalinou Posts: 409Admin Godot Developer
    edited March 30

    I have a GTX 1080 and an offline video rendering script I could put to good use ;)

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 30

    Oh that's great! As for the offline rendering, I though about it and I'd prefer to show off how it can do in realtime. But maybe I'll change my minfd. So yeah. When it's ready I'll let y'all know! :) So you'd like to help demonstrate @Calinou?

  • CalinouCalinou Posts: 409Admin Godot Developer
    edited March 30

    @SIsilicon28 I prefer prerendering a video whenever possible for various reasons:

    • You can get perfect frame pacing (zero dropped frames), which is nearly impossible when recording a video of a demanding scene in real-time. You can also record videos at a higher resolution than your display supports, or record a demanding scene on slow hardware (it'll just take more time).
    • You can enable supersampling to get smoother results (even compared to MSAA, as SSAA also works on transparent textures and shaders).
  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited March 30

    @Calinou Yes, I get those points, but since it's a demonstration of what it would look like practically in a game, doing a better looking, offline render makes it feel like I'm bending the truth as to what you'd expect to see in a real project in real time; especially since the renderer uses temporal reprojection.

    Edit: But you know what? I could have part of the demonstration rendered offline, but most of it will require user interaction, so it would have to be done in real time.

  • MegalomaniakMegalomaniak Posts: 2,605Admin

    I was about to say, yes, you could have the video in two parts, first a 'glamor shot' so to speak, with some extreme maxed out settings showing off the full potential and then a 'live demonstration' following up after.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    @Megalomaniak Yeah! That's a wonderful idea.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    Here it is! With these new features, the plugin's code is release ready (I think)! All that's left is documentation.

    • I've added some limited transparency supported. It's not perfect, but it will do.
    • Volumes can now be in spheres and not just cubes.
    • Directional Light shadows are supported now.

    So yeah. After I do some documentation, the plugin will be ready for public use. I'm so excited! :D :D

  • DschoonmakerDschoonmaker Posts: 229Member

    Wow, this is great? Is it just a MeshInstance with a shader?

    By the way, I'm also working on a potato GPU, same as you, actually ;)

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited April 2

    @Dschoonmaker said:
    Wow, this is great? Is it just a MeshInstance with a shader?

    By the way, I'm also working on a potato GPU, same as you, actually ;)

    Well it's actually a lot more complicated than that. ๐Ÿ˜…
    But here's the basic run down of the effect.

    1. I render the volume properties into some viewports that act as a "volume buffer". There's 5 in total for scattering, extinction, emission, phase, and motion (to better work with temporal reprojection later).
    2. I do my lighting calculations based on the volume buffer to generate scattering and extinction colours for each froxel. I also optionally do some temporal blending with the previous frame's buffer to smooth out the result.
    3. I accumulate this lighting data in each layer of the buffer.
    4. The final result is blended with a couple quads. One for extinction and the other for scattering.
      4b. Any registered transparent objects will be given a material to do the same thing above.

    All of this is based on how frostbite did it. Because Godot doesn't support 3D viewports, I had to emulate it.

  • DschoonmakerDschoonmaker Posts: 229Member

    Very nice. So is it all done on a quad placed in front of the camera?

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited April 2

    ...no.
    I just told you that there is more to it than that. It's not just slapping a shader onto a quad with a couple uniforms. I also had to manage the sampling of each Viewport, the volume proxys' materials (each one with five shaders). I even had to reinvent shadow mapping, since I can't use the one Godot generates!

    Sorry if I sound upset. Keep in mind that this took a while to develop, and debug, and fine-tune.

  • DschoonmakerDschoonmaker Posts: 229Member
    edited April 2

    I know, I'm just confused about how this works. How can you have 5 shaders? Do you have 5 meshes?
    Maybe I should just look at the source code :/

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    My code's a bit messy right now, but if you think you can understand it then go ahead.

  • DschoonmakerDschoonmaker Posts: 229Member
    edited April 2

    Whoa.
    Looks complicated, especially your own implementation of shadow mapping :o
    I'm not sure if I could ever hope to understand your code, but it looks really nice.
    Sounds like you have enough volunteers, but I'll also help if you need more (and if my GPU isn't too bad).
    Edit: I kind of understand, at least the froxel part.

  • MegalomaniakMegalomaniak Posts: 2,605Admin
    edited April 2

    Downloading it now, will probably take a couple of days to toy around with it a bit then see what to record and at what exact resolution to record.

    edit: you might want to create a basic readme.md for the repo already though. ;)

  • SIsilicon28SIsilicon28 Posts: 703Moderator
    edited April 2

    @Megalomaniak said:
    Downloading it now, will probably take a couple of days to toy around with it a bit then see what to record and at what exact resolution to record.

    edit: you might want to create a basic readme.md for the repo already though. ;)

    Yeah I'm gonna make the readme. I wanted to do that after I got all the coding out of the way, so you may wait until documentation is complete.

  • MegalomaniakMegalomaniak Posts: 2,605Admin

    yeah, just tried to load it in 3.2.1 and got this:

    https://pastebin.com/323sUz61

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    I hate case is mismatching! >:(
    Lemme take care of that.

  • SIsilicon28SIsilicon28 Posts: 703Moderator

    Ok I fixed the name cases on most of the files (not the images for the scene though).

Sign In or Register to comment.