Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Standard fixed function OpenGL illumination is only evaluated at the vertex positions and the determined colours interpolated over the primitives. So get a spotlight effect, the illumination must be evaluated with high resolution. You can achieve this by either tesselating your plane, or by using a fragment shader that does <em>per fragment lighting</em>.</p> <hr> <p><strong>EDIT to answer comment</strong></p> <h3>Tesselation</h3> <p>Tesselation means, subdividing your plane into a large number of "patches". Like this:</p> <pre><code>+---------------------+ | | | | | | | | | | | | | | | | | | | | +---------------------+ </code></pre> <p>→</p> <pre><code>+-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ | | | | | | | | | | | | +-+-+-+-+-+-+-+-+-+-+-+ </code></pre> <h3>Per fragment lighting</h3> <p>Per fragment lighting means, that the lighting equation is evaluated at each rasterized fragment (a fragment is what's commonly referred to a pixel). For this a <em>fragment shader</em> is used, i.e. a small program load into the graphics processor (GPU), that's executed for each fragment/pixel of the rasterized primitive (triangle, line, point).</p> <p>Lighthouse3D has a tutorial about it: <a href="http://www.lighthouse3d.com/tutorials/glsl-tutorial/spot-light-per-pixel/" rel="nofollow">http://www.lighthouse3d.com/tutorials/glsl-tutorial/spot-light-per-pixel/</a> I recommend you read the full GLSL tutorial there, to get an idea, what's going on.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload