Visual Sky shader
Asked Answered
D

4

0

I came across this Blender addon called Physical Starlight and Atmosphere that I decided to buy in order to have a look at its internals and see if I can learn something. It ends up it's not that complex, yet the creator is very skilled, in the sense that the end result still looks great.

After finishing my own shader, seen in the image above, I just forgot about it, mainly due to how badly it was coded, since if you want to use it, you must apply it in a rectangle, make sure it aligns with the rest of the seen, has the correct size, etc.

What the author of the blender addon is doing instead, is to create a custom Blender node, and from what I understand edit the skybox of the scene, pictured above. I want to do something similar. How can I create a visual shader that will edit Godot's skybox? Or if that is not possible, what is the next best similar solution

Dorelle answered 21/4, 2022 at 20:23 Comment(0)
G
0

Godot doesn't have sky shaders in Godot 3.x, but this is a feature that will be coming to Godot 4.0: https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/sky_shader.html

You can test 4.0alpha6. You may not need a custom sky shader for this use case, as there's a built-in PhysicalSkyMaterial which provides a physically accurate sky material with Raleigh/Mie scattering.

In Godot 3.x, you could use a shader that renders to a dual parabolid texture, and apply this texture to a MeshInstance with a large SphereMesh. This will not update the radiance map (used for ambient and reflected light) in real-time, but this will give the illusion of a real-time sky shader. See my comment here for more details: https://github.com/godotengine/godot-proposals/issues/3593#issuecomment-1013970711

Gamber answered 21/4, 2022 at 22:30 Comment(0)
D
0

My goal mainly is to experiment and so I don't necessarily need the built-in material, even though I'm sure it will be great to have. I mainly aim to create something similar to the Blender addon I linked. And of course one of the most important points is that it should light the whole scene. But I understand from your comment, and linked github page that it wont be that easy. I will keep investigating and update this post if I manage to find something interesting. Maybe a volumetric lighting setup would be a good starting point. I don't know how to do that yet, but I'm sure I can find something to get me started.

Dorelle answered 22/4, 2022 at 0:16 Comment(0)
G
0

There's a volumetrics add-on for Godot 3.x, but it can be quite slow on lower-end hardware: https://github.com/SIsilicon/Godot-Volumetrics-Plugin Godot 4.0alpha has built-in volumetric fog (both global and local with FogVolume nodes).

You may also be interested in https://github.com/Lexpartizan/Godot_sky_shader.

Gamber answered 22/4, 2022 at 23:7 Comment(0)
D
0

The volumetrics plugin is a bit demanding indeed, it also has some weird artefacts for me. The sky shader though looks definitely interesting. I will start with that as a structure and build my own stuff on top of it.

Dorelle answered 24/4, 2022 at 21:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.