diff options
author | Jeroen Bakker <jeroen@blender.org> | 2020-11-17 15:12:21 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2020-11-17 15:12:21 +0300 |
commit | 03ad2958d3ecc391105baf6c347031e87fa1f41c (patch) | |
tree | e581e13861f84f1fc8322a1fb091e89363cc39b9 /source/blender/draw/engines/overlay/shaders | |
parent | 88de58fd1af9ffb1c6afcc53cf6279aadc51f58c (diff) | |
parent | 1e1c39fc89395c5e5a68a7a21500195cd8dc6fd5 (diff) |
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/draw/engines/overlay/shaders')
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/edit_uv_stencil_image_vert.glsl | 14 | ||||
-rw-r--r-- | source/blender/draw/engines/overlay/shaders/image_frag.glsl | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/draw/engines/overlay/shaders/edit_uv_stencil_image_vert.glsl b/source/blender/draw/engines/overlay/shaders/edit_uv_stencil_image_vert.glsl new file mode 100644 index 00000000000..d22cc795e66 --- /dev/null +++ b/source/blender/draw/engines/overlay/shaders/edit_uv_stencil_image_vert.glsl @@ -0,0 +1,14 @@ +#pragma BLENDER_REQUIRE(common_view_lib.glsl) + +in vec3 pos; +out vec2 uvs; + +void main() +{ + /* `pos` contains the coordinates of a quad (-1..1). but we need the coordinates of an image + * plane (0..1) */ + vec3 image_pos = pos * 0.5 + 0.5; + vec4 position = point_object_to_ndc(image_pos); + gl_Position = position; + uvs = image_pos.xy; +} diff --git a/source/blender/draw/engines/overlay/shaders/image_frag.glsl b/source/blender/draw/engines/overlay/shaders/image_frag.glsl index 4d37f1599a3..6e68d156f25 100644 --- a/source/blender/draw/engines/overlay/shaders/image_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/image_frag.glsl @@ -1,3 +1,4 @@ +#pragma BLENDER_REQUIRE(common_colormanagement_lib.glsl) uniform sampler2D imgTexture; uniform bool imgPremultiplied; |