Screen Space Reflection Shader (SSRS) – By SebastianMestre
Have you ever wanted to have a very shiny and reflective environment in your game? Considering you are using UPBGE, then you should try this Screen Space Reflection Shader made by SebastianMestre posted in blenderartist forums.
So, what is this shader? This is the explanation from the author:
This is a 2d filter that does raymarching in screen space. Ray to Depth-Buffer intersections are found through a simple raymarch and refined with binary search.
Glossiness is achieved through the emission of multiple rays with importance sampled directions; Currently, the GGX NDF is used for this purpose. A home-brewed hashing function is the source source of the pseudo-random numbers used in sampling and jittering.
Schlick’s approximation is sampled once per ray to ensure proper weighting of rays.
The filter expects three properties to be added to the object containing the filter actuator:
- Float – roughness (roughness of the reflections)
- Float – reflectance (reflectance at normal incidence)
- Integer – samples (amount of rays used per pixel)
There are also some settings within the filter that should be modified to match your camera setup.
Look at the following video:
As you can notice every object in the scenario looks reflective and may not be suitable for every game, but nonetheless it is a very interesting approach, maybe in the future the author finds a way to make the reflections “object selective” so you can choose wich one you want to be reflective.
Anyway as I said before, I find very interesting this shader and I like how it looks in my game in progress “CrafTal”
And just in case you don’t know what UPBGE is, then go here and see for yourself. In short terms is a blender game engine fork, but with LOTS of improvements that were never implemented in the Blender Foundation official versions.
Download the shader from here, and if you like you can go directly to the forum and read the whole thread and see improvements and future updates if any.
Need to know how to use a shader? Read this post