Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2017-10-27 17:20:33 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-10-27 23:49:15 +0300
commit4f7665c84410e9e25360b0d80ce073c54242e5d4 (patch)
tree58b248d3fd41d1312e6f7bfd455cb583f251137b /source/blender/gpu
parent18ba7e26ad445981fb2750ec4bef1273f11d1554 (diff)
Eevee: Volumetrics: Add Volume object support.
This is quite basic as it only support boundbing boxes. But the material can refine the volume shape in anyway the user like. To overcome this limitation, a voxelisation should be done on the mesh (generating a SDF maybe?) and tested against every volumetric cell.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/shaders/gpu_shader_material.glsl8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl
index fb89c554775..0dd8e6643b2 100644
--- a/source/blender/gpu/shaders/gpu_shader_material.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_material.glsl
@@ -2470,7 +2470,11 @@ float hypot(float x, float y)
void generated_from_orco(vec3 orco, out vec3 generated)
{
#ifdef VOLUMETRICS
+#ifdef MESH_SHADER
+ generated = volumeObjectLocalCoord;
+#else
generated = worldPosition;
+#endif
#else
generated = orco;
#endif
@@ -4053,7 +4057,11 @@ void node_bump(float strength, float dist, float height, vec3 N, vec3 surf_pos,
void node_output_material(Closure surface, Closure volume, float displacement, out Closure result)
{
+#ifdef VOLUMETRICS
+ result = volume;
+#else
result = surface;
+#endif
}
uniform float backgroundAlpha;