565
565
NUX_RETURN_IF_FALSE (m_AsmColor.IsValid());
567
float fx = x, fy = y;
567
568
float VtxBuffer[] =
569
x, y, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
570
x, y + height, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
571
x + width, y + height, 0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
572
x + width, y, 0.0f, 1.0f, c3.R(), c3.G(), c3.B(), c3.A(),
570
fx, fy, 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
571
fx, fy + height, 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
572
fx + width, fy + height, 0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
573
fx + width, fy, 0.0f, 1.0f, c3.red, c3.green, c3.blue, c3.alpha,
575
576
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
615
616
NUX_RETURN_IF_FALSE (m_AsmTextureRectModColor.IsValid());
617
618
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
619
float fx = x, fy = y;
618
620
float VtxBuffer[] =
620
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
621
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
622
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
623
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
622
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
623
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
624
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
625
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
626
628
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
684
686
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
688
float fx = x, fy = y;
686
689
float VtxBuffer[] =
688
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
689
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
690
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
691
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
691
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
692
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
693
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
694
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
694
697
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
753
756
QRP_Compute_Texture_Coord (width, height, device_texture0, texxform0);
754
757
QRP_Compute_Texture_Coord (width, height, device_texture1, texxform1);
759
float fx = x, fy = y;
756
760
float VtxBuffer[] =
758
x, y, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
759
x, y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
760
x + width, y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
761
x + width, y, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
762
fx, fy, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
763
fx, fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
764
fx + width, fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
765
fx + width, fy, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
764
768
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
785
789
int TextureCoord0Location = VTXATTRIB_TEXCOORD0;
786
790
int TextureCoord1Location = VTXATTRIB_TEXCOORD1;
788
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
789
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
792
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
793
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
791
795
CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
792
796
CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
827
831
QRP_Compute_Texture_Coord (width, height, distorsion_texture, texxform0);
828
832
QRP_Compute_Texture_Coord (width, height, src_device_texture, texxform1);
834
float fx = x, fy = y;
830
835
float VtxBuffer[] =
832
x, y, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
833
x, y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
834
x + width, y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
835
x + width, y, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
837
fx, fy, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
838
fx, fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
839
fx + width, fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
840
fx + width, fy, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
838
843
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
859
864
int TextureCoord0Location = VTXATTRIB_TEXCOORD0;
860
865
int TextureCoord1Location = VTXATTRIB_TEXCOORD1;
862
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A() ) );
863
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, c1.R(), c1.G(), c1.B(), c1.A() ) );
867
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha ) );
868
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, c1.red, c1.green, c1.blue, c1.alpha ) );
865
870
CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
866
871
CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
900
905
QRP_Compute_Texture_Coord (width, height, device_texture0, texxform0);
901
906
QRP_Compute_Texture_Coord (width, height, device_texture1, texxform1);
908
float fx = x, fy = y;
903
909
float VtxBuffer[] =
905
x, y, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
906
x, y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
907
x + width, y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
908
x + width, y, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
911
fx, fy, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0.0f, 1.0f, texxform1.u0, texxform1.v0, 0.0f, 1.0f,
912
fx, fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0.0f, 1.0f, texxform1.u0, texxform1.v1, 0.0f, 1.0f,
913
fx + width, fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0.0f, 1.0f, texxform1.u1, texxform1.v1, 0.0f, 1.0f,
914
fx + width, fy, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0.0f, 1.0f, texxform1.u1, texxform1.v0, 0.0f, 1.0f,
911
917
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
932
938
int TextureCoord0Location = VTXATTRIB_TEXCOORD0;
933
939
int TextureCoord1Location = VTXATTRIB_TEXCOORD1;
935
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
936
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
941
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
942
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
938
944
CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
939
945
CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 48, VtxBuffer) );
977
983
QRP_Compute_Texture_Coord (width, height, device_texture2, texxform1);
978
984
QRP_Compute_Texture_Coord (width, height, device_texture3, texxform1);
986
float fx = x, fy = y;
980
987
float VtxBuffer[] =
982
x, y, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0, 1.0f, texxform1.u0, texxform1.v0, 0, 1.0f, texxform2.u0, texxform2.v0, 0, 1.0f, texxform3.u0, texxform3.v0, 0, 1.0f,
983
x, y + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0, 1.0f, texxform1.u0, texxform1.v1, 0, 1.0f, texxform2.u0, texxform2.v1, 0, 1.0f, texxform3.u0, texxform3.v1, 0, 1.0f,
984
x + width, y + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0, 1.0f, texxform1.u1, texxform1.v1, 0, 1.0f, texxform2.u1, texxform2.v1, 0, 1.0f, texxform3.u1, texxform3.v1, 0, 1.0f,
985
x + width, y, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0, 1.0f, texxform1.u1, texxform1.v0, 0, 1.0f, texxform2.u1, texxform2.v0, 0, 1.0f, texxform3.u1, texxform3.v0, 0, 1.0f,
989
fx, fy, 0.0f, 1.0f, texxform0.u0, texxform0.v0, 0, 1.0f, texxform1.u0, texxform1.v0, 0, 1.0f, texxform2.u0, texxform2.v0, 0, 1.0f, texxform3.u0, texxform3.v0, 0, 1.0f,
990
fx, fy + height, 0.0f, 1.0f, texxform0.u0, texxform0.v1, 0, 1.0f, texxform1.u0, texxform1.v1, 0, 1.0f, texxform2.u0, texxform2.v1, 0, 1.0f, texxform3.u0, texxform3.v1, 0, 1.0f,
991
fx + width, fy + height, 0.0f, 1.0f, texxform0.u1, texxform0.v1, 0, 1.0f, texxform1.u1, texxform1.v1, 0, 1.0f, texxform2.u1, texxform2.v1, 0, 1.0f, texxform3.u1, texxform3.v1, 0, 1.0f,
992
fx + width, fy, 0.0f, 1.0f, texxform0.u1, texxform0.v0, 0, 1.0f, texxform1.u1, texxform1.v0, 0, 1.0f, texxform2.u1, texxform2.v0, 0, 1.0f, texxform3.u1, texxform3.v0, 0, 1.0f,
988
995
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1013
1020
int TextureCoord2Location = VTXATTRIB_TEXCOORD2;
1014
1021
int TextureCoord3Location = VTXATTRIB_TEXCOORD3;
1016
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.R(), color0.G(), color0.B(), color0.A() ) );
1017
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.R(), color1.G(), color1.B(), color1.A() ) );
1018
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color2.R(), color2.G(), color2.B(), color2.A() ) );
1019
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color3.R(), color3.G(), color3.B(), color3.A() ) );
1023
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, color0.red, color0.green, color0.blue, color0.alpha ) );
1024
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color1.red, color1.green, color1.blue, color1.alpha ) );
1025
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color2.red, color2.green, color2.blue, color2.alpha ) );
1026
CHECKGL ( glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color3.red, color3.green, color3.blue, color3.alpha ) );
1021
1028
CHECKGL ( glEnableVertexAttribArrayARB (VertexLocation) );
1022
1029
CHECKGL ( glVertexAttribPointerARB ( (GLuint) VertexLocation, 4, GL_FLOAT, GL_FALSE, 80, VtxBuffer) );
1083
1090
float VtxBuffer[] =
1085
x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1086
x1, y1, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
1087
x2, y2, 0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
1092
static_cast<float>(x0), static_cast<float>(y0), 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
1093
static_cast<float>(x1), static_cast<float>(y1), 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
1094
static_cast<float>(x2), static_cast<float>(y2), 0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
1090
1097
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1136
1143
float VtxBuffer[] =
1138
x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1139
x1, y1, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
1145
static_cast<float>(x0), static_cast<float>(y0), 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
1146
static_cast<float>(x1), static_cast<float>(y1), 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
1142
1149
ObjectPtr<IOpenGLAsmShaderProgram> ShaderProg = m_AsmColor;
1186
1193
NUX_RETURN_IF_FALSE (m_AsmColor.IsValid());
1195
float fx0 = x0, fy0 = y0;
1188
1196
float VtxBuffer[] =
1190
x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1191
x0, y0 + height - 1, 0.0f, 1.0f, c1.R(), c1.G(), c1.B(), c1.A(),
1192
x0 + width - 1, y0 + height - 1, 0.0f, 1.0f, c2.R(), c2.G(), c2.B(), c2.A(),
1193
x0 + width - 1, y0, 0.0f, 1.0f, c3.R(), c3.G(), c3.B(), c3.A(),
1194
x0, y0, 0.0f, 1.0f, c0.R(), c0.G(), c0.B(), c0.A(),
1198
fx0, fy0, 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
1199
fx0, fy0 + height - 1, 0.0f, 1.0f, c1.red, c1.green, c1.blue, c1.alpha,
1200
fx0 + width - 1, fy0 + height - 1, 0.0f, 1.0f, c2.red, c2.green, c2.blue, c2.alpha,
1201
fx0 + width - 1, fy0, 0.0f, 1.0f, c3.red, c3.green, c3.blue, c3.alpha,
1202
fx0, fy0, 0.0f, 1.0f, c0.red, c0.green, c0.blue, c0.alpha,
1197
1205
ObjectPtr<IOpenGLAsmShaderProgram> ShaderProg = m_AsmColor;
1287
1295
NUX_RETURN_IF_FALSE (_asm_texrect_component_exponentiation_prog.IsValid());
1289
1297
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
1298
float fx = x, fy = y;
1290
1299
float VtxBuffer[] =
1292
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1293
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1294
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1295
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1301
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1302
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1303
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1304
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1298
1307
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1386
1395
NUX_RETURN_IF_FALSE (_asm_texrect_alpha_replicate_prog.IsValid());
1388
1397
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
1398
float fx = x, fy = y;
1389
1399
float VtxBuffer[] =
1391
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1392
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1393
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1394
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1401
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1402
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1403
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1404
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1397
1407
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1508
1518
NUX_RETURN_IF_FALSE (_asm_texrect_color_matrix_filter_prog.IsValid());
1510
1520
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
1521
float fx = x, fy = y;
1511
1522
float VtxBuffer[] =
1513
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1514
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1515
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1516
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1524
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f,
1525
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f,
1526
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f,
1527
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f,
1519
1530
CHECKGL (glBindBufferARB (GL_ARRAY_BUFFER_ARB, 0) );
1529
1540
SetTexture (GL_TEXTURE0, device_texture);
1531
CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.R(), c0.G(), c0.B(), c0.A()));
1542
CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 0, c0.red, c0.green, c0.blue, c0.alpha));
1532
1543
CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 1, color_matrix.m[0][0], color_matrix.m[0][1], color_matrix.m[0][2], color_matrix.m[0][3]));
1533
1544
CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 2, color_matrix.m[1][0], color_matrix.m[1][1], color_matrix.m[1][2], color_matrix.m[1][3]));
1534
1545
CHECKGL (glProgramLocalParameter4fARB (GL_FRAGMENT_PROGRAM_ARB, 3, color_matrix.m[2][0], color_matrix.m[2][1], color_matrix.m[2][2], color_matrix.m[2][3]));
1668
1680
texxform.u0 + 1.0f * delta, texxform.v0, 0, 1.0f,
1669
1681
texxform.u0 + 2.0f * delta, texxform.v0, 0, 1.0f,
1670
1682
texxform.u0 + 3.0f * delta, texxform.v0, 0, 1.0f,
1671
x, y + height, 0.0f, 1.0f,
1683
fx, fy + height, 0.0f, 1.0f,
1672
1684
texxform.u0 - 3.0f * delta, texxform.v1, 0, 1.0f,
1673
1685
texxform.u0 - 2.0f * delta, texxform.v1, 0, 1.0f,
1674
1686
texxform.u0 - 1.0f * delta, texxform.v1, 0, 1.0f,
1676
1688
texxform.u0 + 1.0f * delta, texxform.v1, 0, 1.0f,
1677
1689
texxform.u0 + 2.0f * delta, texxform.v1, 0, 1.0f,
1678
1690
texxform.u0 + 3.0f * delta, texxform.v1, 0, 1.0f,
1679
x + width, y + height, 0.0f, 1.0f,
1691
fx + width, fy + height, 0.0f, 1.0f,
1680
1692
texxform.u1 - 3.0f * delta, texxform.v1, 0, 1.0f,
1681
1693
texxform.u1 - 2.0f * delta, texxform.v1, 0, 1.0f,
1682
1694
texxform.u1 - 1.0f * delta, texxform.v1, 0, 1.0f,
1684
1696
texxform.u1 + 1.0f * delta, texxform.v1, 0, 1.0f,
1685
1697
texxform.u1 + 2.0f * delta, texxform.v1, 0, 1.0f,
1686
1698
texxform.u1 + 3.0f * delta, texxform.v1, 0, 1.0f,
1687
x + width, y, 0.0f, 1.0f,
1699
fx + width, fy, 0.0f, 1.0f,
1688
1700
texxform.u1 - 3.0f * delta, texxform.v0, 0, 1.0f,
1689
1701
texxform.u1 - 2.0f * delta, texxform.v0, 0, 1.0f,
1690
1702
texxform.u1 - 1.0f * delta, texxform.v0, 0, 1.0f,
1798
1811
texxform.u0, texxform.v0 + 1.0f * delta, 0, 1.0f,
1799
1812
texxform.u0, texxform.v0 + 2.0f * delta, 0, 1.0f,
1800
1813
texxform.u0, texxform.v0 + 3.0f * delta, 0, 1.0f,
1801
x, y + height, 0.0f, 1.0f,
1814
fx, fy + height, 0.0f, 1.0f,
1802
1815
texxform.u0, texxform.v1 - 3.0f * delta, 0, 1.0f,
1803
1816
texxform.u0, texxform.v1 - 2.0f * delta, 0, 1.0f,
1804
1817
texxform.u0, texxform.v1 - 1.0f * delta, 0, 1.0f,
1806
1819
texxform.u0, texxform.v1 + 1.0f * delta, 0, 1.0f,
1807
1820
texxform.u0, texxform.v1 + 2.0f * delta, 0, 1.0f,
1808
1821
texxform.u0, texxform.v1 + 3.0f * delta, 0, 1.0f,
1809
x + width, y + height, 0.0f, 1.0f,
1822
fx + width, fy + height, 0.0f, 1.0f,
1810
1823
texxform.u1, texxform.v1 - 3.0f * delta, 0, 1.0f,
1811
1824
texxform.u1, texxform.v1 - 2.0f * delta, 0, 1.0f,
1812
1825
texxform.u1, texxform.v1 - 1.0f * delta, 0, 1.0f,
1814
1827
texxform.u1, texxform.v1 + 1.0f * delta, 0, 1.0f,
1815
1828
texxform.u1, texxform.v1 + 2.0f * delta, 0, 1.0f,
1816
1829
texxform.u1, texxform.v1 + 3.0f * delta, 0, 1.0f,
1817
x + width, y, 0.0f, 1.0f,
1830
fx + width, fy, 0.0f, 1.0f,
1818
1831
texxform.u1, texxform.v0 - 3.0f * delta, 0, 1.0f,
1819
1832
texxform.u1, texxform.v0 - 2.0f * delta, 0, 1.0f,
1820
1833
texxform.u1, texxform.v0 - 1.0f * delta, 0, 1.0f,
2006
2019
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2007
2020
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2008
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
2021
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2010
2023
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2011
2024
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2061
2074
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2062
2075
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2063
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
2076
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2065
2078
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2066
2079
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2110
2123
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width, quad_height);
2111
2124
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2112
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, Colors::White);
2125
QRP_ASM_1Tex(0, 0, quad_width, quad_height, device_texture, texxform, color::White);
2114
2127
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width, quad_height);
2115
2128
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2171
2184
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt0, _offscreen_depth_rt0, quad_width/2, quad_height/2);
2172
2185
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2173
QRP_ASM_1Tex (0, 0, quad_width / 2, quad_height / 2, device_texture, texxform, Colors::White);
2186
QRP_ASM_1Tex (0, 0, quad_width / 2, quad_height / 2, device_texture, texxform, color::White);
2175
2188
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt1, _offscreen_depth_rt1, quad_width/4, quad_height/4);
2176
2189
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2177
QRP_ASM_1Tex (0, 0, quad_width / 4, quad_height / 4, _offscreen_color_rt0, texxform, Colors::White);
2190
QRP_ASM_1Tex (0, 0, quad_width / 4, quad_height / 4, _offscreen_color_rt0, texxform, color::White);
2179
2192
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt2, _offscreen_depth_rt2, quad_width/8, quad_height/8);
2180
2193
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2181
QRP_ASM_1Tex (0, 0, quad_width / 8, quad_height / 8, _offscreen_color_rt1, texxform, Colors::White);
2194
QRP_ASM_1Tex (0, 0, quad_width / 8, quad_height / 8, _offscreen_color_rt1, texxform, color::White);
2183
2196
SetFrameBufferHelper(_offscreen_fbo, _offscreen_color_rt3, _offscreen_depth_rt3, quad_width, quad_height);
2184
2197
glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
2185
2198
QRP_ASM_4Tex (0, 0, quad_width, quad_height,
2186
device_texture, texxform, Colors::White,
2187
_offscreen_color_rt0, texxform, Colors::White,
2188
_offscreen_color_rt1, texxform, Colors::White,
2189
_offscreen_color_rt2, texxform, Colors::White);
2199
device_texture, texxform, color::White,
2200
_offscreen_color_rt0, texxform, color::White,
2201
_offscreen_color_rt1, texxform, color::White,
2202
_offscreen_color_rt2, texxform, color::White);
2191
2204
_offscreen_fbo->Deactivate();
2263
2276
NUX_RETURN_IF_FALSE (m_AsmPixelate.IsValid());
2264
2277
NUX_RETURN_IF_FALSE (m_AsmPixelateRect.IsValid());
2266
2279
if (pixel_size <= 0)
2267
2280
pixel_size = 1;
2269
2282
QRP_Compute_Texture_Coord (width, height, device_texture, texxform);
2283
float fx = x, fy = y;
2270
2284
float VtxBuffer[] =
2272
x, y, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2273
x, y + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2274
x + width, y + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2275
x + width, y, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.R(), color.G(), color.B(), color.A(),
2286
fx, fy, 0.0f, 1.0f, texxform.u0, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
2287
fx, fy + height, 0.0f, 1.0f, texxform.u0, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
2288
fx + width, fy + height, 0.0f, 1.0f, texxform.u1, texxform.v1, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
2289
fx + width, fy, 0.0f, 1.0f, texxform.u1, texxform.v0, 0, 1.0f, color.red, color.green, color.blue, color.alpha,
2278
2292
float tex_width = device_texture->GetWidth ();