diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-10-08 12:25:24 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-10-08 18:20:09 +0300 |
commit | eea22dd5ef0aaf58066bbff460315c8867741920 (patch) | |
tree | 9b835f732c4395b81e570ddf103d39770da20e92 /source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl | |
parent | ba3ef44a6b57970b278c3a99a7ee00906efa3eb7 (diff) |
Workbench: Smoke: Fix display
Includes the following fixes
- Fix smoke texture creation: data was interpreted as Byte instead of Floats.
- Fix Velocity texture not being free after draw: also was causing crashes.
- Fix display_thickness not being copied during COW.
- Fix Blending and general volume rendering algorithm.
- Add Volume Shadowing support.
Diffstat (limited to 'source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl')
-rw-r--r-- | source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl b/source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl index 90a22d9d02f..7ce21c3d5ca 100644 --- a/source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl +++ b/source/blender/draw/engines/workbench/shaders/workbench_volume_vert.glsl @@ -1,5 +1,6 @@ uniform mat4 ModelViewProjectionMatrix; +uniform vec3 OrcoTexCoFactors[2]; uniform float slicePosition; uniform int sliceAxis; /* -1 is no slice, 0 is X, 1 is Y, 2 is Z. */ @@ -23,9 +24,10 @@ void main() else { localPos = vec3(pos.xy, slicePosition * 2.0 - 1.0); } - - gl_Position = ModelViewProjectionMatrix * vec4(localPos, 1.0); + vec3 final_pos = localPos; #else - gl_Position = ModelViewProjectionMatrix * vec4(pos, 1.0); + vec3 final_pos = pos; #endif + final_pos = ((final_pos * 0.5 + 0.5) - OrcoTexCoFactors[0]) / OrcoTexCoFactors[1]; + gl_Position = ModelViewProjectionMatrix * vec4(final_pos, 1.0); } |