|
| 1 | + |
| 2 | +out gl_PerVertex { vec4 gl_Position; }; |
| 3 | + |
| 4 | +struct vf |
| 5 | +{ |
| 6 | + float2 tc0 ; // TEXCOORD0; // base |
| 7 | + float4 c0 ; // COLOR0; // color |
| 8 | +// Igor: for additional depth dest |
| 9 | +#ifdef USE_SOFT_PARTICLES |
| 10 | + float4 tctexgen ; // TEXCOORD1; |
| 11 | +#endif // USE_SOFT_PARTICLES |
| 12 | + float4 hpos; // SV_Position; |
| 13 | +}; |
| 14 | + |
| 15 | +#ifdef SKIN_NONE |
| 16 | +layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1) |
| 17 | +#else |
| 18 | +layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized |
| 19 | +#endif |
| 20 | +#ifdef SKIN_0 |
| 21 | +layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz) |
| 22 | +#else |
| 23 | +layout(location = NORMAL) in float4 v_model_N ; // NORMAL; // (nx,ny,nz,index) |
| 24 | +#endif |
| 25 | +#if defined(SKIN_3) || defined(SKIN_4) |
| 26 | +layout(location = TANGENT) in float4 v_model_T ; // TANGENT; // (nx,ny,nz,weight0) |
| 27 | +layout(location = BINORMAL) in float4 v_model_B ; // BINORMAL; // (nx,ny,nz,weight1) |
| 28 | +#else |
| 29 | +layout(location = TANGENT) in float3 v_model_T ; // TANGENT; // (nx,ny,nz) |
| 30 | +layout(location = BINORMAL) in float3 v_model_B ; // BINORMAL; // (nx,ny,nz) |
| 31 | +#endif |
| 32 | +#ifdef SKIN_NONE |
| 33 | +layout(location = TEXCOORD0) in float2 v_model_tc ; // TEXCOORD0; // (u,v) |
| 34 | +#elif defined(SKIN_2) || defined(SKIN_3) |
| 35 | +layout(location = TEXCOORD0) in int4 v_model_tc ; // TEXCOORD0; // (u,v) |
| 36 | +#else |
| 37 | +layout(location = TEXCOORD0) in int2 v_model_tc ; // TEXCOORD0; // (u,v) |
| 38 | +#endif |
| 39 | +#ifdef SKIN_4 |
| 40 | +layout(location = TEXCOORD1) in float4 v_model_ind ; // (x=m-index0, y=m-index1, z=m-index2, w=m-index3) |
| 41 | +#endif |
| 42 | + |
| 43 | +layout(location = TEXCOORD0) out float2 v2p_particle_tc0; // TEXCOORD0; |
| 44 | +layout(location = COLOR0) out float4 v2p_particle_c0 ; // COLOR0; |
| 45 | +#ifdef USE_SOFT_PARTICLES |
| 46 | +layout(location = TEXCOORD1) out float4 v2p_particle_tctexgen; // TEXCOORD1; |
| 47 | +#endif // USE_SOFT_PARTICLES |
| 48 | + |
| 49 | +vf _main (v_model v); |
| 50 | + |
| 51 | +void main() |
| 52 | +{ |
| 53 | +#ifdef SKIN_NONE |
| 54 | + v_model I; |
| 55 | +#endif |
| 56 | +#ifdef SKIN_0 |
| 57 | + v_model_skinned_0 I; |
| 58 | +#endif |
| 59 | +#ifdef SKIN_1 |
| 60 | + v_model_skinned_1 I; |
| 61 | +#endif |
| 62 | +#ifdef SKIN_2 |
| 63 | + v_model_skinned_2 I; |
| 64 | +#endif |
| 65 | +#ifdef SKIN_3 |
| 66 | + v_model_skinned_3 I; |
| 67 | +#endif |
| 68 | +#ifdef SKIN_4 |
| 69 | + v_model_skinned_4 I; |
| 70 | + I.ind = v_model_ind; |
| 71 | +#endif |
| 72 | + |
| 73 | + I.P = v_model_P; |
| 74 | + I.N = v_model_N; |
| 75 | + I.T = v_model_T; |
| 76 | + I.B = v_model_B; |
| 77 | + I.tc = v_model_tc; |
| 78 | + |
| 79 | + vf O; |
| 80 | +#ifdef SKIN_NONE |
| 81 | + O = _main(I); |
| 82 | +#endif |
| 83 | +#ifdef SKIN_0 |
| 84 | + O = _main(skinning_0(I)); |
| 85 | +#endif |
| 86 | +#ifdef SKIN_1 |
| 87 | + O = _main(skinning_1(I)); |
| 88 | +#endif |
| 89 | +#ifdef SKIN_2 |
| 90 | + O = _main(skinning_2(I)); |
| 91 | +#endif |
| 92 | +#ifdef SKIN_3 |
| 93 | + O = _main(skinning_3(I)); |
| 94 | +#endif |
| 95 | +#ifdef SKIN_4 |
| 96 | + O = _main(skinning_4(I)); |
| 97 | +#endif |
| 98 | + |
| 99 | + v2p_particle_tc0 = O.tc0; |
| 100 | + v2p_particle_c0 = O.c0; |
| 101 | + v2p_particle_tctexgen = O.tctexgen; |
| 102 | + gl_Position = O.hpos; |
| 103 | +} |
0 commit comments