Ignore:
Timestamp:
Nov 19, 2012, 1:45:44 AM (8 years ago)
Author:
sam
Message:

neercs: use gl_VertexID instead of sending a whole new vertex array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/text.lolfx

    r2090 r2091  
    55#define HAVE_UINT 1
    66
    7 attribute vec2 in_Position;
    87#if HAVE_UINT
    98attribute uint in_Char, in_Attr;
     
    1615varying vec2 pass_UV;
    1716
    18 uniform float u_PointSize;
     17uniform vec2 u_DataSize;
    1918uniform mat4 u_Transform;
    2019
     
    5857
    5958    // This only works with glEnable(GL_VERTEX_PROGRAM_POINT_SIZE);
    60     gl_PointSize = u_PointSize;
     59    gl_PointSize = u_DataSize[1];
    6160
    62     gl_Position = u_Transform * vec4(in_Position, 0.0, 1.0);
     61    vec2 coord = vec2(gl_VertexID % int(u_DataSize[0]),
     62                      gl_VertexID / int(u_DataSize[0]));
     63    gl_Position = u_Transform * vec4(coord, 0.0, 1.0);
    6364}
    6465
Note: See TracChangeset for help on using the changeset viewer.