Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/modes/shaders/object_camera_image_vert.glsl
- This file was added.
| uniform mat4 TransformMat; | |||||
| uniform bool flipX; | |||||
| uniform bool flipY; | |||||
| in vec2 texCoord; | |||||
| in vec2 pos; | |||||
| out vec2 texCoord_interp; | |||||
| void main() | |||||
| { | |||||
| vec2 pos_s = (pos-0.5) * 2.0; | |||||
jbakker: Better names for pos_s, pos2d | |||||
| vec4 pos2d = TransformMat * vec4(pos_s, 1.0, 1.0); | |||||
| gl_Position = vec4(pos2d.xy, 0.0, 1.0); | |||||
| vec2 uv_mul = vec2(1.0); | |||||
| if (flipX) { | |||||
jbakkerAuthorUnsubmitted Done Inline Actionsin stead of booleans we can use a vec2. jbakker: in stead of booleans we can use a vec2. | |||||
| uv_mul.x = -1; | |||||
| } | |||||
| if (flipY) { | |||||
| uv_mul.y = -1; | |||||
| } | |||||
| texCoord_interp = texCoord * uv_mul; | |||||
| } | |||||
Better names for pos_s, pos2d