Ignore:
Timestamp:
Dec 20, 2012, 2:01:28 AM (10 years ago)
Author:
sam
Message:

neercs: some fallback code when shader model 4 isn’t available.

File:
1 edited

Legend:

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

    r2154 r2155  
    33#version 130
    44
    5 #define HAVE_UINT 1
     5#define HAVE_SHADER_4 1
    66
    7 #if HAVE_UINT
     7#if HAVE_SHADER_4
    88in uint in_Char, in_Attr;
    99#else
    1010in vec4 in_Char, in_Attr;
     11in float in_VertexID;
    1112#endif
    1213
     
    2021void main()
    2122{
    22 #if HAVE_UINT
     23#if HAVE_SHADER_4
    2324    float u = float(in_Char & 0xfu) / 32.0 + 0.0;
    2425    float v = float((in_Char >> 4u) & 0xfu) / 32.0 + 0.5;
     
    3132    pass_UV = vec2(u, v);
    3233
    33 #if HAVE_UINT
     34#if HAVE_SHADER_4
    3435    float A = float(in_Attr >> 29u) / 7.0;
    3536    float B = float((in_Attr >> 25u) & 0xfu) / 15.0;
     
    6364    gl_PointSize = u_DataSize[1];
    6465
     66#if HAVE_SHADER_4
    6567    vec2 coord = vec2(gl_VertexID % int(u_DataSize[0]),
    6668                      gl_VertexID / int(u_DataSize[0]));
     69#else
     70    vec2 coord = vec2(mod(in_VertexID, u_DataSize[0]),
     71                      floor(in_VertexID / u_DataSize[0]));
     72#endif
     73
    6774    gl_Position = u_Transform * vec4(coord, 0.0, 1.0);
    6875}
Note: See TracChangeset for help on using the changeset viewer.