1. Anders Ruud
  2. love
  3. Issues


Issue #293 resolved

Suggestion: provide premade vertex shaders for PixelEffects

Alex Szpakowski
created an issue

There are a few situations where PixelEffects would benefit from having a vertex shader which passed along the world-space position as a varying.

Perhaps if the PixelEffect pre-processor detects "varying worldpos;" or something similar then it could activate a pre-made vertex shader which would pass the world position along as a varying (varying = interpolated across the fragments).

There may be one or two other vertex shaders which might be useful but I don't know them yet. :P

Comments (4)

  1. Alex Szpakowski reporter

    I keep encountering situations where it's either possible to do something in the frag shader or a premade vertex shader would solve it, but in the former case it would be much faster to have it in the vertex shader and in the latter case it's very hack-ish, and the hacks would keep building up.

    What's the most difficult thing about implementing full vertex shader support? I don't think the Lua API would need significant changes, especially because vertex shaders would be used much less than fragment shaders. Having newPixelEffect and setPixelEffect accept either a single fragment shader or both a vertex shader and a fragment shader should be enough, right?

  2. Log in to comment