diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-16 20:38:40 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-04-16 20:38:58 +0300 |
commit | 7f5d76b37fc909b15a72df725c70c8443c8e760e (patch) | |
tree | 7668249d8b8ee8f69ac9c55f394b3e2947397164 /source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl | |
parent | c2d4ba2ff54b47a8053c8dd19411186d2a050115 (diff) |
Object Mode: Rework outline drawing.
This changes quite a few things.
- Outline is now per object.
- No more outline at object intersection (fix hairs problem).
- Simplify the code quite a bit.
We use a R16UI buffer to save one id per object outline. We convert this id
to color when detecting the outline.
Added textureGatherOffsets to the code but could not test on current hardware
so leaving it commented for now.
Diffstat (limited to 'source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl')
-rw-r--r-- | source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl b/source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl new file mode 100644 index 00000000000..776adb787ad --- /dev/null +++ b/source/blender/draw/modes/shaders/object_outline_prepass_frag.glsl @@ -0,0 +1,10 @@ +uniform int callId; +uniform int baseId; + +/* using uint because 16bit uint can contain more ids than int. */ +out uint outId; + +void main() +{ + outId = uint(baseId + callId); +} |