1. Anders Ruud
  2. love
  3. Issues


Issue #841 resolved

Add LÖVE-provided shader variable containing the viewport size

Alex Szpakowski
created an issue

The pixel coordinates passed to the effect function in the pixel shader are unnormalized (i.e. in the range of [0, w], [0, h]), but it's often useful to normalize them - which requires the viewport size. There are several other uses for it as well.

Shaders can have their own extern variable containing the viewport size, but it would be more convenient for LÖVE to provide it automatically.

Most of the code necessary for doing this is already there.

Comments (1)

  1. Log in to comment