diff --git a/.gitignore b/.gitignore index 6b6c839..1b52551 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /helloWorld/build/ -/helloWorld/nbproject/private/ \ No newline at end of file +/helloWorld/nbproject/private/ +/dist/ \ No newline at end of file diff --git a/build/built-jar.properties b/build/built-jar.properties index 01945bc..451cabb 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Tue, 25 Jul 2017 12:58:27 -0400 +#Mon, 07 Aug 2017 13:41:51 -0400 C\:\\Users\\labramson\\Documents\\Tutorial= diff --git a/build/classes/tutorial/clTexture/Main.class b/build/classes/tutorial/clTexture/Main.class index eea93f8..0143708 100644 Binary files a/build/classes/tutorial/clTexture/Main.class and b/build/classes/tutorial/clTexture/Main.class differ diff --git a/build/classes/tutorial/clTexture3d/Main.class b/build/classes/tutorial/clTexture3d/Main.class index e7b06f0..67a4b02 100644 Binary files a/build/classes/tutorial/clTexture3d/Main.class and b/build/classes/tutorial/clTexture3d/Main.class differ diff --git a/lib/Jama-1.0.3.jar b/lib/Jama-1.0.3.jar new file mode 100644 index 0000000..c800759 Binary files /dev/null and b/lib/Jama-1.0.3.jar differ diff --git a/lib/SimpleITKJava.dll b/lib/SimpleITKJava.dll new file mode 100644 index 0000000..2c4f58d Binary files /dev/null and b/lib/SimpleITKJava.dll differ diff --git a/lib/jdom-2.0.6.jar b/lib/jdom-2.0.6.jar new file mode 100644 index 0000000..2850ca1 Binary files /dev/null and b/lib/jdom-2.0.6.jar differ diff --git a/lib/libjinput-osx.dylib b/lib/libjinput-osx.dylib new file mode 100644 index 0000000..59a3eab Binary files /dev/null and b/lib/libjinput-osx.dylib differ diff --git a/lib/liblwjgl.dylib b/lib/liblwjgl.dylib new file mode 100644 index 0000000..a6083b9 Binary files /dev/null and b/lib/liblwjgl.dylib differ diff --git a/lib/log4j-api-2.7.jar b/lib/log4j-api-2.7.jar new file mode 100644 index 0000000..b921631 Binary files /dev/null and b/lib/log4j-api-2.7.jar differ diff --git a/lib/log4j-core-2.7.jar b/lib/log4j-core-2.7.jar new file mode 100644 index 0000000..c0feb23 Binary files /dev/null and b/lib/log4j-core-2.7.jar differ diff --git a/lib/openal.dylib b/lib/openal.dylib new file mode 100644 index 0000000..3c6d0f7 Binary files /dev/null and b/lib/openal.dylib differ diff --git a/lib/simpleitk-1.0.0.jar b/lib/simpleitk-1.0.0.jar new file mode 100644 index 0000000..a54dea9 Binary files /dev/null and b/lib/simpleitk-1.0.0.jar differ diff --git a/lib/xchart-3.2.2.jar b/lib/xchart-3.2.2.jar new file mode 100644 index 0000000..575b622 Binary files /dev/null and b/lib/xchart-3.2.2.jar differ diff --git a/nbproject/project.properties b/nbproject/project.properties index 524bfb8..7c8d44b 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -86,7 +86,7 @@ javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= -main.class=tutorial.clTexture.Main +main.class=tutorial.clTexture3d.Main manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false diff --git a/src/tutorial/clTexture/Main.java b/src/tutorial/clTexture/Main.java index 265e934..e37088f 100644 --- a/src/tutorial/clTexture/Main.java +++ b/src/tutorial/clTexture/Main.java @@ -106,7 +106,7 @@ public Main() { public static void main(String... args) throws Exception { //IMAGE FILE String imgDir = "C:\\Users\\labramson\\Documents\\Tutorial\\res\\"; - String imgName = "texture.png"; + String imgName = "smileTexture.jpg"; String imgName2 = "blank.jpg"; //CREATE IMAGE OBJECT img = new Image(imgDir + "" + imgName); diff --git a/src/tutorial/clTexture3d/Main.java b/src/tutorial/clTexture3d/Main.java index 80a6081..f3597e6 100644 --- a/src/tutorial/clTexture3d/Main.java +++ b/src/tutorial/clTexture3d/Main.java @@ -29,6 +29,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.ShortBuffer; +import static org.lwjgl.opencl.CL10.CL_DEVICE_TYPE_GPU; import static org.lwjgl.opencl.CL10.CL_PROGRAM_BUILD_LOG; import static org.lwjgl.opencl.CL10.CL_QUEUE_PROFILING_ENABLE; import static org.lwjgl.opencl.CL10.clEnqueueNDRangeKernel; @@ -41,7 +42,6 @@ import static org.lwjgl.opengl.ARBSync.GL_SYNC_GPU_COMMANDS_COMPLETE; import static org.lwjgl.opengl.ARBSync.glFenceSync; import static org.lwjgl.opengl.ARBSync.glWaitSync; -import static org.lwjgl.opengl.ARBTextureRg.GL_R16; import static org.lwjgl.opengl.ARBTextureRg.GL_R16F; import static org.lwjgl.opengl.GL11.*; import static org.lwjgl.opengl.GL12.*; @@ -54,45 +54,11 @@ * @author labramson */ public class Main { + //public static Image img; //public static Image img2; private Texture inTexture, outTexture; - static final String kernel_Sample - = "kernel void imgTest(__read_only image2d_t inputTexture){\n" - + " int2 imgCoords = (int2)(get_global_id(0), get_global_id(1));\n" - + " //printf(\"Coord x:%d Coord y:%d \", imgCoords.x, imgCoords.y);\n\n" - + " const sampler_t smp = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;\n\n" - + " float4 imgVal = read_imagef(inputTexture, smp, imgCoords); \n" - + " printf(\"(%d, %d) RGBA(%f, %f, %f, %f)\\n\", imgCoords.x, imgCoords.y, imgVal.x, imgVal.y, imgVal.z, imgVal.w);\n" - + "}"; - static final String kernel_3DImage - = "kernel void imgTest2(__read_only image3d_t inTexture, __write_only image3d_t outTexture){\n" - + " #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n" - + " const sampler_t smp = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;\n\n" - + " int4 coord = (int4)(get_global_id(0), get_global_id(1), get_global_id(2), 0);\n" - + " int4 coordL = (int4)(get_global_id(0)-1, get_global_id(1), get_global_id(2), 0);\n" - + " int4 coordR = (int4)(get_global_id(0)+1, get_global_id(1), get_global_id(2), 0);\n" - + " int4 coordT = (int4)(get_global_id(0), get_global_id(1)-1, get_global_id(2), 0);\n" - + " int4 coordBo = (int4)(get_global_id(0), get_global_id(1)+1, get_global_id(2), 0);\n" - + " int4 coordF = (int4)(get_global_id(0), get_global_id(1), get_global_id(2)-1, 0);\n" - + " int4 coordBa = (int4)(get_global_id(0), get_global_id(1), get_global_id(2)-1, 0);\n" - + " float4 pixel = read_imagef(inTexture, smp, coord);\n" - + " float4 pixelL = read_imagef(inTexture, smp, coordL);\n" - + " float4 pixelR = read_imagef(inTexture, smp, coordR);\n" - + " float4 pixelT = read_imagef(inTexture, smp, coordT);\n" - + " float4 pixelBo = read_imagef(inTexture, smp, coordBo);\n" - + " float4 pixelF = read_imagef(inTexture, smp, coordF);\n" - + " float4 pixelBa = read_imagef(inTexture, smp, coordBa);\n" - + " pixel.x = (pixelR.x - pixelL.x); \n" - + " if (pixel.x < 0.0) {pixel.x = -pixel.x;} \n" - + " pixel.y = pixelT.x - pixelBo.x; \n" - + " if (pixel.y < 0.0) {pixel.y = -pixel.y;} \n" - + " pixel.z = pixelF.x - pixelBa.x; \n" - + " if (pixel.z < 0.0) {pixel.z = -pixel.z;} \n" - + " write_imagef(outTexture, coord, pixel);\n" - + "}"; - //VARS FOR CL CONVERSION private CLCommandQueue[] queues; //array of cl command queues private CLContext context; //CL context @@ -118,6 +84,57 @@ public class Main { private int deviceType = CL10.CL_DEVICE_TYPE_GPU; private int slices; //dividing up the image for faster processing private static final int MAX_GPUS = 8; //Max GPUs used at once + private static final int texDimX = 512, texDimY = 512, texDimZ = 512; + + static final String kernel_Sample + = "kernel void imgTest(__read_only image2d_t inputTexture){\n" + + " int2 imgCoords = (int2)(get_global_id(0), get_global_id(1));\n" + + " //printf(\"Coord x:%d Coord y:%d \", imgCoords.x, imgCoords.y);\n\n" + + " const sampler_t smp = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;\n\n" + + " float4 imgVal = read_imagef(inputTexture, smp, imgCoords); \n" + + " printf(\"(%d, %d) RGBA(%f, %f, %f, %f)\\n\", imgCoords.x, imgCoords.y, imgVal.x, imgVal.y, imgVal.z, imgVal.w);\n" + + "}"; + static final String kernel_3DImage + = "kernel void imgTest2(__read_only image3d_t inTexture, __write_only image3d_t outTexture){\n" + + " #pragma OPENCL EXTENSION cl_khr_3d_image_writes : enable\n" + + " #pragma OPENCL EXTENSION cl_khr_fp64 : enable\n" + + " const sampler_t smp = CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_CLAMP_TO_EDGE | CLK_FILTER_NEAREST;\n\n" + + " int4 offsets[27] = " + + " {(int4)(-1,-1,-1,0), (int4)(-1,0,-1,0), (int4)(-1,1,-1,0)," + + " (int4)(-1,-1,0,0), (int4)(-1,0,0,0), (int4)(-1,1,0,0)," + + " (int4)(-1,-1,1,0), (int4)(-1,0,1,0), (int4)(-1,1,1,0)," + + " (int4)(0,-1,-1,0), (int4)(0,0,-1,0), (int4)(0,1,-1,0)," + + " (int4)(0,-1,0,0), (int4)(0,0,0,0), (int4)(0,1,0,0)," + + " (int4)(0,-1,1,0), (int4)(0,0,1,0), (int4)(0,1,1,0)," + + " (int4)(1,-1,-1,0), (int4)(1,0,-1,0), (int4)(1,1,-1,0)," + + " (int4)(1,-1,0,0), (int4)(1,0,0,0), (int4)(1,1,0,0)," + + " (int4)(1,-1,1,0), (int4)(1,0,1,0), (int4)(1,1,1,0)};\n" + + " const float sqrt3 = sqrt((float)3)/3;\n" + + " const float sqrt2 = sqrt((float)2)/2;\n" + + " float weightsX[27] = {-sqrt3, -sqrt2, -sqrt3, -sqrt2, -1, " + + " -sqrt2, -sqrt3, -sqrt2, -sqrt3, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n" + + " sqrt3, sqrt2, sqrt3, sqrt2, 1, sqrt2, sqrt3, sqrt2, sqrt3};\n" + + " float weightsY[27] = {-sqrt3, 0, sqrt3, -sqrt2, 0, sqrt2,-sqrt3, 0," + + " sqrt3, -sqrt2, 0, sqrt2, -1, 0, 1, -sqrt2, 0, sqrt2, -sqrt3, 0, " + + " sqrt3, -sqrt2, 0, sqrt2, -sqrt3, 0, sqrt3};\n" + + " float weightsZ[27] = {-sqrt3, -sqrt2, -sqrt3, 0, 0, 0, sqrt3, sqrt2," + + " sqrt3, -sqrt2, -1, -sqrt2, 0, 0, 0, sqrt2, 1, sqrt2, -sqrt3, -sqrt2," + + " -sqrt3, 0, 0, 0, sqrt3, sqrt2, sqrt3};\n" + + " int4 coord = (int4)(get_global_id(0), get_global_id(1), get_global_id(2), 0);\n" + + " float4 pixel;" + + " for(int i = 0; i<27; i++){" + + " pixel.x += read_imagef(inTexture, smp, (coord+offsets[i])).x*weightsX[i];\n" + + " pixel.y += read_imagef(inTexture, smp, (coord+offsets[i])).x*weightsY[i];\n" + + " pixel.z += read_imagef(inTexture, smp, (coord+offsets[i])).x*weightsZ[i];\n" + + " }" + //+ " pixel.x = (pixel.x + 1.0)/2.0; //pixel.y = (pixel.y + 1.0)/2.0; //pixel.z = (pixel.z + 1.0)/2.0;" + + " float mag = native_sqrt(pixel.x * pixel.x + pixel.y * pixel.y + pixel.z * pixel.z);" + + " pixel.x /= mag; " + + "pixel.y /= mag; " + + "pixel.z /= mag; " + + "pixel.w = 0;" + + " write_imagef(outTexture, coord, pixel);\n" + + "}"; //CONSTRUCTOR public Main() { @@ -166,7 +183,7 @@ public static void main(String... args) throws Exception { public static void initDisplay() { try { - Display.setDisplayMode(new DisplayMode(300, 300)); + Display.setDisplayMode(new DisplayMode(700, 700)); Display.setTitle("Texture Demo"); Display.create(); } catch (LWJGLException e) { @@ -178,7 +195,7 @@ public static void initDisplay() { public static void initGL() { glMatrixMode(GL_PROJECTION); glLoadIdentity(); - glOrtho(0, 300, 300, 0, 10, -300); + glOrtho(0, 700, 700, 0, 0, -700); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); } @@ -212,28 +229,25 @@ public void initGLTexture() throws Exception { if (useTextures) { GL11.glGenTextures(glIDs); for (int i = 0; i < slices; i++) { - ByteBuffer bbuf = BufferUtil.newByteBuffer(64 * 64 * 64 * 2); + ByteBuffer bbuf = BufferUtil.newByteBuffer(texDimX * texDimY * texDimZ * 2); ShortBuffer sbuf = bbuf.asShortBuffer(); - for (int z=0; z<64; z++) { - for (int y=0; y<64; y++) { - for (int x=0; x<64; x++) { + for (int z = 0; z < texDimZ; z++) { + for (int y = 0; y < texDimY; y++) { + for (int x = 0; x < texDimX; x++) { short value = 0; - if ( x>16 && x<50 && y>16 && y<50 && z>16 && z<50) { + if (x > 120 && x < 400 && y > 120 && y < 400 && z > 120 && z < 400) { value = 32767; - } - else if ( x>18 && x<48 && y>18 && y<48 && z>18 && z<48) { + } else if (x > 160 && x < 270 && y > 160 && y < 270 && z > 160 && z < 270) { value = 128; } sbuf.put(value); } } } - - bbuf.flip(); bbuf.order(ByteOrder.LITTLE_ENDIAN); - - Texture texture = new Texture(64, 64, 64, GL_R16F, bbuf); + + Texture texture = new Texture(texDimX, texDimY, texDimZ, GL_R16F, bbuf); glBuffers[i] = CL10GL.clCreateFromGLTexture3D(context, CL10.CL_MEM_READ_ONLY, texture.getTarget(), 0, texture.getId(), null); inTexture = texture; } @@ -262,7 +276,7 @@ public void initWritableTexture() throws Exception { if (useTextures) { GL11.glGenTextures(glIDs2); for (int i = 0; i < slices; i++) { - Texture texture = new Texture(64, 64, 64, GL_RGBA16F, null); + Texture texture = new Texture(texDimX, texDimY, texDimZ, GL_RGBA16F, null); glBuffersOut[i] = CL10GL.clCreateFromGLTexture3D(context, CL10.CL_MEM_WRITE_ONLY, texture.getTarget(), 0, texture.getId(), null); outTexture = texture; } @@ -288,13 +302,14 @@ public void initCL() { final Filter glSharingFilter; glSharingFilter = (final CLDevice device) -> { - final CLDeviceCapabilities abilities = CLCapabilities.getDeviceCapabilities(device); - System.out.println(abilities.CL_KHR_3d_image_writes); + CLDeviceCapabilities abilities = CLCapabilities.getDeviceCapabilities(device); + System.out.println("3d_image_writes: " + abilities.CL_KHR_3d_image_writes); + System.out.println("gl_sharing: " + abilities.CL_KHR_gl_sharing); return abilities.CL_KHR_gl_sharing; }; - + // List of LJWGL CLDevice objects representing hardware or software contexts that OpenCL can use - List devices = platform.getDevices(CL10.CL_DEVICE_TYPE_GPU); + List devices = platform.getDevices(CL10.CL_DEVICE_TYPE_GPU, glSharingFilter); if (devices == null) { deviceType = CL10.CL_DEVICE_TYPE_CPU; devices = platform.getDevices(CL10.CL_DEVICE_TYPE_CPU, glSharingFilter); @@ -302,7 +317,8 @@ public void initCL() { throw new RuntimeException("No OpenCL devices found with KHR_gl_sharing support."); } } - System.out.println("Devices obtained"); + System.out.println(devices.size() + " GPU devices found."); + slices = min(devices.size(), MAX_GPUS); System.out.println("Slices: " + slices); @@ -435,6 +451,7 @@ public void display() throws Exception { glFinish(); } + //System.out.println((Sys.getTime() * 1000) / Sys.getTimerResolution()); //IF THE GL TEXTURE BUFFERS HAVE NOT BEEN INITIALIZED if (!buffersInitialized) { initGLTexture(); @@ -448,20 +465,19 @@ public void display() throws Exception { } //SETS THE WORKSIZE OF THE KERNEL - kernel2DGlobalWorkSize.put(0, 64).put(1, 64).put(2, 64); - + kernel2DGlobalWorkSize.put(0, texDimX).put(1, texDimY).put(2, texDimZ); + long start = 0; //GETS THE GL OBJECTS for (int i = 0; i < slices; i++) { // acquire GL objects, and enqueue a kernel with a probe from the list clEnqueueAcquireGLObjects(queues[i], glBuffers[i], null, null); clEnqueueAcquireGLObjects(queues[i], glBuffersOut[i], null, null); - + start = (Sys.getTime() * 1000) / Sys.getTimerResolution(); clEnqueueNDRangeKernel(queues[i], kernels[i], 3, null, kernel2DGlobalWorkSize, null, null, null); - CL10GL.clEnqueueReleaseGLObjects(queues[i], glBuffers[i], null, syncGLtoCL ? syncBuffer : null); CL10GL.clEnqueueReleaseGLObjects(queues[i], glBuffersOut[i], null, syncGLtoCL ? syncBuffer : null); if (syncGLtoCL) { @@ -478,10 +494,10 @@ public void display() throws Exception { } //RENDER THE TEXTURE - render(); + render(start); } - private void render() { + private void render(long start) { if (syncGLtoCL) { for (int i = 0; i < slices; i++) { glWaitSync(clSyncs[i], 0, 0); @@ -490,99 +506,41 @@ private void render() { //draw slices //int sliceWidth = texture.getWidth() / slices; - for (int i = 0; i < slices; i++) { //int seperatorOffset = drawSeparator ? i : 0; - + //SETS GL SETTINGS glSettings(); //BIND THE TEXTURE - glEnable(GL_TEXTURE_3D); glBindTexture(GL_TEXTURE_3D, outTexture.getId()); //DRAW A CUBE WITH MAPPED TEXTURE glBegin(GL_QUADS); - //System.out.println("Drawing front"); + + //System.out.println("Drawing front"); +// glTexCoord3f(0f, 0f, 0.5f); +// glVertex3f(100, 100, 0); //upper left +// glTexCoord3f(0f, 1.0f, 0.5f); +// glVertex3f(100, 200, 0); //upper right +// glTexCoord3f(1.0f, 1.0f, 0.5f); +// glVertex3f(200, 200, 0); //bottom right +// glTexCoord3f(1.0f, 0f, 0.5f); +// glVertex3f(200, 100, 0); //bottom left glTexCoord3f(0f, 0f, 0.5f); - glVertex3f(100, 100, 0); //upper left + glVertex3f(250, 250, 0); //upper left glTexCoord3f(0f, 1.0f, 0.5f); - glVertex3f(100, 200, 0); //upper right + glVertex3f(250, 450, 0); //upper right glTexCoord3f(1.0f, 1.0f, 0.5f); - glVertex3f(200, 200, 0); //bottom right + glVertex3f(450, 450, 0); //bottom right glTexCoord3f(1.0f, 0f, 0.5f); - glVertex3f(200, 100, 0); //bottom left - -// // Top-face -// System.out.println("Drawing top"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(1.0f, 1.0f, -1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(-1.0f, 1.0f, -1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(-1.0f, 1.0f, 1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(1.0f, 1.0f, 1.0f); -// -// // Bottom-face -// System.out.println("Drawing bottom"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(1.0f, -1.0f, 1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(-1.0f, -1.0f, 1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(-1.0f, -1.0f, -1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(1.0f, -1.0f, -1.0f); -// -// // Front-face -// System.out.println("Drawing front"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(1.0f, 1.0f, 1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(-1.0f, 1.0f, 1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(-1.0f, -1.0f, 1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(1.0f, -1.0f, 1.0f); -// -// // Back-face -// System.out.println("Drawing back"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(1.0f, -1.0f, -1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(-1.0f, -1.0f, -1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(-1.0f, 1.0f, -1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(1.0f, 1.0f, -1.0f); -// -// // Left-face -// System.out.println("Drawing left"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(-1.0f, 1.0f, 1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(-1.0f, 1.0f, -1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(-1.0f, -1.0f, -1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(-1.0f, -1.0f, 1.0f); -// -// // Right-face -// System.out.println("Drawing right"); -// glTexCoord3f(0f, 0f, 0f); -// glVertex3f(1.0f, 1.0f, -1.0f); -// glTexCoord3f(0f, 1.0f, 0f); -// glVertex3f(1.0f, 1.0f, 1.0f); -// glTexCoord3f(1.0f, 1.0f, 0f); -// glVertex3f(1.0f, -1.0f, 1.0f); -// glTexCoord3f(1.0f, 0f, 0f); -// glVertex3f(1.0f, -1.0f, -1.0f); + glVertex3f(450, 250, 0); //bottom left glEnd(); - + glBindTexture(GL_TEXTURE_3D, 0); glDisable(GL_TEXTURE_3D); + System.out.println("Time: " + ((Sys.getTime() * 1000) / Sys.getTimerResolution() - start)); } //CHECKING SYNC @@ -591,4 +549,4 @@ private void render() { glEvent = clCreateEventFromGLsyncKHR(context, glSync, null); } } -} \ No newline at end of file +}