10 lines
43 KiB
HLSL
10 lines
43 KiB
HLSL
|
#ifndef VRBNTRANSFORMUVS_INCLUDE
|
|||
|
#define VRBNTRANSFORMUVS_INCLUDE
|
|||
|
|
|||
|
static const uint nmbg = 10;
|
|||
|
static const uint nfbg = 5;
|
|||
|
static const uint nrtbg = 21;
|
|||
|
|
|||
|
static float4 urbg[nrtbg*nmbg][nfbg] = {{float4(0.0,0.567689657211,0.0,0.14192225039),float4(0.851806640625,0.946421325207,0.071044921875,0.142006248236),float4(0.851806640625,0.946421325207,0.0,0.0709613263607),float4(0.56787109375,0.85171598196,0.568359375,0.662973940372),float4(0.56787109375,0.85171598196,0.0,0.0946151018143)},{float4(0.0,0.567689657211,0.14208984375,0.284012079239),float4(0.851806640625,0.946421325207,0.213134765625,0.284096091986),float4(0.851806640625,0.946421325207,0.14208984375,0.213051170111),float4(0.56787109375,0.85171598196,0.6630859375,0.757700502872),float4(0.56787109375,0.85171598196,0.0947265625,0.189341664314)},{float4(0.0,0.567689657211,0.2841796875,0.426101922989),float4(0.851806640625,0.946421325207,0.355224609375,0.426185935736),float4(0.851806640625,0.946421325207,0.2841796875,0.355141013861),float4(0.56787109375,0.85171598196,0.7578125,0.852427065372),float4(0.56787109375,0.85171598196,0.189453125,0.284068226814)},{float4(0.0,0.567689657211,0.42626953125,0.568191766739),float4(0.851806640625,0.946421325207,0.497314453125,0.568275809288),float4(0.851806640625,0.946421325207,0.42626953125,0.497230857611),float4(0.0,0.283844918013,0.8525390625,0.947153627872),float4(0.56787109375,0.85171598196,0.2841796875,0.378794789314)},{float4(0.0,0.567689657211,0.568359375,0.710281610489),float4(0.851806640625,0.946421325207,0.639404296875,0.710365653038),float4(0.851806640625,0.946421325207,0.568359375,0.639320731163),float4(0.283935546875,0.567780435085,0.8525390625,0.947153627872),float4(0.56787109375,0.85171598196,0.37890625,0.473521351814)},{float4(0.0,0.567689657211,0.71044921875,0.852371454239),float4(0.851806640625,0.946421325207,0.781494140625,0.852455496788),float4(0.851806640625,0.946421325207,0.71044921875,0.781410574913),float4(0.56787109375,0.85171598196,0.8525390625,0.947153627872),float4(0.56787109375,0.85171598196,0.4736328125,0.568247914314)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0)}, {float4(0.0,0.597656190395,0.0,0.199218928814),float4(0.896484375,0.996093511581,0.499267578125,0.598877310753),float4(0.896484375,0.996093511581,0.0,0.0996097400784),float4(0.59765625,0.896484375,0.099609375,0.199218541384),float4(0.59765625,0.896484375,0.0,0.0996091589332)},{float4(0.0,0.597656190395,0.199462890625,0.398681819439),float4(0.896484375,0.996093511581,0.59912109375,0.698730826378),float4(0.896484375,0.996093511581,0.099853515625,0.199463263154),float4(0.59765625,0.896484375,0.298828125,0.398437291384),float4(0.59765625,0.896484375,0.19921875,0.298827916384)},{float4(0.0,0.597656190395,0.39892578125,0.598144710064),float4(0.896484375,0.996093511581,0.698974609375,0.798584342003),float4(0.896484375,0.996093511581,0.19970703125,0.299316763878),float4(0.59765625,0.896484375,0.498046875,0.597656011581),float4(0.59765625,0.896484375,0.3984375,0.498046666384)},{float4(0.0,0.597656190395,0.598388671875,0.797607600689),float4(0.896484375,0.996093511581,0.798828125,0.898437857628),float4(0.896484375,0.996093511581,0.299560546875,0.399170279503),float4(0.59765625,0.896484375,0.697265625,0.796874761581),float4(0.59765625,0.896484375,0.59765625,0.697265386581)},{float4(0.0,0.597656190395,0.7978515625,0.997070491314),float4(0.896484375,0.996093511581,0.898681640625,0.998291373253),float4(0.896484375,0.996093511581,0.3994140625,0.499023795128),float4(0.59765625,0.896484375,0.896484375,0.996093511581),float4(0.59765625,0.896484375,0.796875,0.896484136581)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0)},{float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0,0.0,0.0,0.0),float4(0.0
|
|||
|
void getVrbnTransformUVs_float(float2 G,float i,float u,float f,out float2 e){float m=0;m=round(f*255./25);float A=u*nmbg;float4 r=urbg[A+m][0];if(i==5)r=urbg[A+m][0],G=1-G;else if(i==3)r=urbg[A+m][4];else if(i==2)r=urbg[A+m][3];else if(i==1)r=urbg[A+m][1],G[0]=1-G[0],G[1]=1-G[1];else if(i==0)r=urbg[A+m][2],G[0]=1-G[0],G[1]=1-G[1];float n=r[1]-r[0];e[0]=r[0]+G[0]*n;float B=r[3]-r[2];e[1]=r[2]+G[1]*B;}
|
|||
|
#endif // VRBNTRANSFORMUVS_INCLUDE
|