Skip to content

Added a FULLRECT_UV keyword in canvas item

QbieShay requested to merge github/fork/QbieShay/fullrect_uv into master

There are some cases where having information on the position compared to the full quad is useful, for example a vertical fade based on the quad's y UV coordinate.

Currently, cases such as atlas and 9patch don't bring information regarding the quad uv. example below, the big white robot is a regular sprite while the smaller block on the left is an atlas. note the different alpha. with COLOR.a = UV.y Screenshot_2019-10-16_11-12-15 with COLOR.a = FULLRECT_UV.y Screenshot_2019-10-16_11-11-53

An alternative solution would be to pass unprocessed UV in the vertex shader, but it could break compat.

This does not work for GLES2's 9patch rect.

Artwork by Manuel Bustamante: https://www.artstation.com/artwork/3oa9lJ

Merge request reports