How to replicate Mix Shader from blender to create an eclipse effect?


I am extremely new to three js and shaders using GLSL. However, I made a material using the Mix Shader node in Blender, using a combination of fresnel, refraction, and emission shaders, and I was able to make exactly what I wanted. But I later found out that, emission shaders and mix shaders are not exportable through GLTF.

Therefore, I was wondering if replicating it was possible in threejs or if the only option was to create my own shader using GLSL


You are looking for the Post processing GodRays effects, here is an excellent step by step tutorial:

You can also check the source code.

1 Like

I’m pretty sure @prisoner849 made a post on this exact effect in the past also

1 Like

Why am I not surprised! here it is:

The man is everywhere, he needs a gallery on his own!

1 Like

Good find, I do recall this one but I’m certain he put up an example of exactly this but using a torus geometry also…