Questions tagged [fragment-shader]

60 questions
12
votes
1 answer

Using a LUT to speed up a trig heavy shader for mobile devices

I am trying to get this shader to run on a really old iDevice, as well as eventually Androids. Even when I reduce the code down to 2 sine functions per fragment the shader runs at about 20fps. I have considered taking a leaf out of the book of old…
J.Doe
  • 1,445
  • 12
  • 23
2
votes
0 answers

How can I draw a line whose position is given in UV space and its width in screen space?

In a fragment shader, I need to draw a line at a given value of u. The shader is applied to a planar polygon mesh that's being drawn in the scene with a perspective camera. (It isn't a full-screen textured quad; that would be easy!) The problem is,…
Dan Hulme
  • 6,780
  • 1
  • 16
  • 35