Changeset 1865


Ignore:
Timestamp:
Sep 3, 2012, 2:41:05 PM (7 years ago)
Author:
sam
Message:

neercs: do not crash if the shader system does not support integer attributes,
but do not display anything yet (the code is not ready).

File:
1 edited

Legend:

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

    r1644 r1865  
    33#version 130
    44
     5#define HAVE_UINT 0
     6
    57attribute vec2 in_Position;
     8#if HAVE_UINT
    69attribute uint in_Char, in_Attr;
     10#else
     11attribute vec4 in_Char, in_Attr;
     12#endif
    713
    814varying vec4 pass_Foreground;
     
    1420void main()
    1521{
     22#if HAVE_UINT
    1623    float u = float(in_Char & 0xfu) / 32.0 + 0.0;
    1724    float v = float((in_Char >> 4u) & 0xfu) / 32.0 + 0.5;
     25#else
     26    float u = 3.0 / 32.0;
     27    float v = 3.0 / 32.0 + 0.5;
     28#endif
    1829    pass_UV = vec2(u, v);
    1930
     31#if HAVE_UINT
    2032    float A = float(in_Attr >> 29u) / 7.0;
    2133    float B = float((in_Attr >> 25u) & 0xfu) / 15.0;
     
    2739    float G = float((in_Attr >> 7u) & 0xfu) / 15.0;
    2840    float H = float((in_Attr >> 4u) & 0x7u) / 7.0;
     41#else
     42    float A = 0.0;
     43    float B = 0.0;
     44    float C = 0.0;
     45    float D = 0.0;
     46
     47    float E = 0.0;
     48    float F = 1.0;
     49    float G = 1.0;
     50    float H = 1.0;
     51#endif
    2952
    3053    pass_Background = vec4(B, C, D, 1.0 - A);
Note: See TracChangeset for help on using the changeset viewer.