Ignore:
Timestamp:
Dec 19, 2012, 11:16:30 PM (10 years ago)
Author:
sam
Message:

neercs: if shaders don't support integer attributes, pass them as vectors
of ubytes; foreground colour already works.

File:
1 edited

Legend:

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

    r2138 r2154  
    2424    float v = float((in_Char >> 4u) & 0xfu) / 32.0 + 0.5;
    2525#else
    26     float u = mod(in_Char.x, 16.0) / 32.0 + 0.0;
    27     float v = floor(in_Char.x / 16.0) / 32.0 + 0.5;
     26    vec4 tmp_Char = in_Char * 255.0;
     27
     28    float u = mod(tmp_Char.x, 16.0) / 32.0 + 0.0;
     29    float v = floor(tmp_Char.x / 16.0) / 32.0 + 0.5;
    2830#endif
    2931    pass_UV = vec2(u, v);
     
    4042    float H = float((in_Attr >> 4u) & 0x7u) / 7.0;
    4143#else
     44    vec4 tmp_Attr = in_Attr * 255.0;
     45
    4246    float A = 0.0;
    4347    float B = 0.0;
     
    4650
    4751    float E = 0.0;
    48     float F = mod(floor(in_Attr.y / 8.0), 16.0) / 15.0;
    49     float G = (mod(in_Attr.y, 8.0) * 2.0 + floor(in_Attr.x / 128.0)) / 15.0;
    50     float H = mod(floor(in_Attr.x / 16.0), 8.0) / 7.0;
     52    float F = mod(floor(tmp_Attr.y / 8.0), 16.0) / 15.0;
     53    float G = (mod(tmp_Attr.y, 8.0) * 2.0 + floor(tmp_Attr.x / 128.0)) / 15.0;
     54    float H = mod(floor(tmp_Attr.x / 16.0), 8.0) / 7.0;
    5155#endif
    5256
Note: See TracChangeset for help on using the changeset viewer.