Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (535)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Image Render and draw  (Read 3669 times)
0 Members and 1 Guest are viewing this topic.
Offline dvgarun

Senior Newbie





« Posted 2005-12-28 06:21:10 »

I am looking for some sample program which can render and dispaly   "2k x 2k  2D image "  in less then 25 msec .
If any one has idea let me know
Offline mabraham

Junior Member





« Reply #1 - Posted 2005-12-28 10:21:18 »

Hey,

I presume that what you want to display is a 32-bit image (RGBA or BGRA), and that you can spend all of those 25ms on actually displaying the image i.e. the image data is ready to be submitted to the gfx card.

I have used PBOs (Pixel Buffer Objects) to stream textures of 1024x1024 to the gfx card which on my system takes around 4..5ms.  Please have a look at my post, http://www.java-gaming.org/forums/index.php?topic=11873.0.  From there you can get to the source code.  The timings should scale linearly with the number of pixels to send, i.e. I expect around 16..20ms for your problem size.  You may also want to read http://oss.sgi.com/projects/ogl-sample/registry/ARB/pixel_buffer_object.txt.

FYI, my system specs: AMD Athlon 4200X2, Asus A8N SLI Premium, PixelView GeForce 7800GT, 2GB DDR.

Hope this helps,
Matt.

PS: Unless you really need to go OpenGL, you can nowadays get equally fast image updates using java2d...
Offline dvgarun

Senior Newbie





« Reply #2 - Posted 2006-01-02 10:23:07 »

1) You said "Unless you really need to go OpenGL, you can nowadays get equally fast image updates using java2d..."

Pls can you tell me how to achive this using only java2d no openGL ?

2) I am new to this jogl .How to give input bufferedImage to your program GLEventHandler.java ?Do you have any main program using GLEventHandler.java which will load the given BufferedImag
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mabraham

Junior Member





« Reply #3 - Posted 2006-01-03 17:17:50 »

1) You said "Unless you really need to go OpenGL, you can nowadays get equally fast image updates using java2d..."

Pls can you tell me how to achive this using only java2d no openGL ?

On 1.5.0_06 I can draw a 1024x1024 BufferedImage with a simple Graphics.drawImage() in just about 3ms.  Admittedly, the image is TYPE_BYTE_INDEXED and not RGBA.  It may be worth you timing the latter before you look any further into OpenGL.  Speaking from my own experience, java2d is really slow at doing alpha blending though, so if you need that then you do want to use OpenGL instead.

2) I am new to this jogl .How to give input bufferedImage to your program GLEventHandler.java ?Do you have any main program using GLEventHandler.java which will load the given BufferedImag

This depends on how you have your BufferedImage set up.  Ideal under Win32 is a BufferedImage of type TYPE_INT_BGR (because this is also the native surface format).  Assuming this is your image format, here's what you might want to do inside your display() method:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
// the image you want to show on the screen
BufferedImage image = getImage();
// access the image data...
Raster raster = image.getRaster();
DataBufferInt imageDataBuffer = (DataBufferInt) raster.getDataBuffer(); // safe cast as we know what type of image we're dealing with!
int[] imageDataArray = imageDataBuffer.getData();
final int width = image.getWidth();
final int height = image.getHeight();
// assuming you have created a texture with a given textureID (and bound that texture), the next line of code updates its image data
gl.glTexSubImage2D( GL.GL_TEXTURE_2D, 0, 0, 0, width, height, GL.GL_BGRA, GL.GL_UNSIGNED_BYTE, IntBuffer.wrap( imageDataArray ) );
// TODO add some OpenGL to draw a textured GL_QUAD...


Note: This is probably not the most efficient way of doing things.  In particular, I'm not certain how well the buffer wrapping the int[] would perform.  Also, instead of specifying a buffer as the last argument to glTexSubImage2D(), you could use the Pixel Buffer Object extension (GL_ARB_pixel_buffer_object, or maybe GL_EXT_pixel_buffer_object) which achieves better performance.  Look at the code example I attached to my other post, or the link I posted above.
Offline dvgarun

Senior Newbie





« Reply #4 - Posted 2006-01-04 08:12:08 »

Ok Thx Lot .
I am looking for some main Java progarm which will use GLEventHandler.java and show the image do you have any main program ?pls can you send me the link or code .
Offline mabraham

Junior Member





« Reply #5 - Posted 2006-01-04 12:25:38 »

Hey,

Please find attached a Java source file 'GLEventHandler.java' which demonstrates exactly what you're after (I hope).  It looks a bit involved maybe, but that's only because I didn't care to clean it up a bit.  Anyway things to look out for:
  • lines 27-28 define the (static) texture dimensions; these must be a power of two each; if your image dimension is not a power of two then you need to do some tiling
  • line 64 establishes whether the Pixel Buffer Extension is available
  • line 140 sets up a BufferedImage of the texture dimensions, of type TYPE_4BYTE_ABGR.  Note there is a problem with this (and the subsequent code) in that the colour channels are the wrong way round, and what you really want is TYPE_4BYTE_BGRA to match the texture format; unfortunately there is no such BI format so you'd have to do some byte swapping which is going to add some 5ms in native code
  • lines 141-172 initialises the BI with some random content
  • line 213 is where your BI is streamed into texture memory, using the PBO extension
  • line 236 is the (slower) alternative where your BI image content is wrapped in a buffer and copied into texture memory
  • lines 248-257 draws a simple quad, mapping your texture appropriately

I have also attached the other classes you need (Messages, StreamingTextures; the latter contains your main() method).  Hope this gives you a starting point.

Oh before I forget, the code does some timing for you.  On my system I get around 18..19ms for PBO-streaming a 2048x2048 BufferedImage!  Even with the traditional non-PBO approach I get a respectable 28ms.  (Ken: in case you were following this conversation, this example is running on a single screen; if I enable the second display then the PBO performance really sucks!).
Offline dvgarun

Senior Newbie





« Reply #6 - Posted 2006-01-05 13:49:52 »

Thx Lot. But i am facing one problem

In Java 2d I created following BufferedImage ...
BufferedImage[] bi = BufferedImage.TYPE_4BYTE_ABGR;
DataBufferByte dbb = (DataBufferByte ) bi.getRaster().getDataBuffer();
byte[] data         = dbb.getData();
// TYPE_4BYTE_ABGR
byte max = (byte) 0xff;
        for (int i = 0; i < w; i++)
            for (int j = 0; j < h; j++)
                if (j % 40 < 20)
                {
                    int basePixel = (i * w + j) * 4;
                    d[basePixel]     = (byte)0xff;
                    d[basePixel + 1] = max;
                    d[basePixel + 2] = max;
                    d[basePixel + 2] =max;
                }
It shows the vertical bars with alternate one black .Attached Doc.

Same thing I added in your GLEventHandler.java program
byte max = (byte) 0xff;
        for (int i = 0; i < w; i++)
            for (int j = 0; j < h; j++)
                if (j % 40 < 20)
                {
                    int basePixel = (i * w + j) * 4;
//OpenGL                   
                d[basePixel]      = max ;
                d[basePixel + 1] = max;
                d[basePixel + 2] = max;
                d[basePixel + 2] =(byte)0xff;

                }

   It shows some bad pattern image(it is not same as in java) , Can u suggest what’s  wrong.
I am excepting the same pattern as in JAVA 2D.
Offline mabraham

Junior Member





« Reply #7 - Posted 2006-01-05 16:01:37 »

Can you send us the display you get with OpenGL please, a simple screen capture should work.
Offline dvgarun

Senior Newbie





« Reply #8 - Posted 2006-01-06 04:31:54 »

Attached is the OpenGL pattern
Offline mabraham

Junior Member





« Reply #9 - Posted 2006-01-06 10:20:53 »

Hey, I'm not sure what the problem is with your code.  Having just added your image initialisation to my code, it shows the vertical stripes just fine (except they are b/w not coloured as in your first screenshot).  I assume there is a problem with the way you set up and update the texture.

Have you actually tried running my code as-is?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline dvgarun

Senior Newbie





« Reply #10 - Posted 2006-01-09 09:14:56 »

Attached is the modified GLEventHandler.txt file .
Pls can you tell me what i am doing wrong .
grep for    images=genImages(5,2022) in attached file .
Also pls can you send me the screen capture of your display .

Thx
Offline mabraham

Junior Member





« Reply #11 - Posted 2006-01-10 00:06:17 »

OK I haven't tried to run your code but there is an obvious problem in that your image dimensions don't match the texture dimensions.  Texture dimensions are specified as 2048x2048 whereas your image is set to 2022x2022 (line 166):
1  
2  
images=genImages(5,2022);
image=images[0];

This means that row 2 of your image starts on row 1 of the texture, around 26 pixels from the end, row 3 starts on row 2 of the texture 52 pixels from the end and so on, leading to the rendered image you've shown.  You have two options, either change your image dimensions to match the texture dimensions, or specify the unpack row length parameter [1] via gl.glPixelStore( GL.GL_UNPACK_ROW_LENGTH, 2022 ) (although I'm not actually certain this will work; it definitely works for images that are larger than your texture).  If you change this parameter in your display() method then be sure to reset it to its original value when you're done, otherwise you might crash the JVM.

Hope this helps!
Matt.

[1] http://www.rush3d.com/reference/opengl-bluebook-1.0/ch05.html#id5514324
Offline dvgarun

Senior Newbie





« Reply #12 - Posted 2006-01-10 05:27:40 »

Thx Lot ! It is working fine .
Offline dvgarun

Senior Newbie





« Reply #13 - Posted 2006-01-10 10:09:02 »

When run it on my Linux Machine it show following out put ...
The Output shows
width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.2 NVIDIA 66.34
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro NVS/AGP/SSE2
GLEventHandler.init(): streaming texture image using PBO
GLEventHandler.12725.5GLEventHandler.2
GLEventHandler.14159.0GLEventHandler.2
GLEventHandler.13535.0GLEventHandler.2
GLEventHandler.12135.0GLEventHandler.2

These are in msec right?
Just want to know any thing extra I have to do so that I will get 25 ms second to render and display the 2048 x 2048 Buffered image?

My Machine glxInfo :
name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.3
server glx extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control
client glx vendor string: NVIDIA Corporation
client glx version string: 1.3
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info,
    GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync,
    GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer,
    GLX_SGI_swap_control, GLX_NV_float_buffer
GLX extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig,
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control,
    GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro NVS/AGP/SSE2
OpenGL version string: 1.5.2 NVIDIA 66.34
OpenGL extensions:
    GL_ARB_imaging, GL_ARB_multitexture, GL_ARB_point_parameters,
    GL_ARB_point_sprite, GL_ARB_shader_objects, GL_ARB_shading_language_100,
    GL_ARB_texture_compression, GL_ARB_texture_cube_map,
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat,
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix,
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader,
    GL_ARB_window_pos, GL_S3_s3tc, GL_EXT_texture_env_add, GL_EXT_abgr,
    GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_minmax,
    GL_EXT_blend_subtract, GL_EXT_clip_volume_hint,
    GL_EXT_compiled_vertex_array, GL_EXT_Cg_shader,
    GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays,
    GL_EXT_packed_pixels, GL_EXT_paletted_texture, GL_EXT_pixel_buffer_object,
    GL_EXT_point_parameters, GL_EXT_rescale_normal, GL_EXT_secondary_color,
    GL_EXT_separate_specular_color, GL_EXT_shared_texture_palette,
    GL_EXT_stencil_wrap, GL_EXT_texture_compression_s3tc,
    GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp,
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3,
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod,
    GL_EXT_texture_lod_bias, GL_EXT_texture_object, GL_EXT_vertex_array,
    GL_IBM_rasterpos_clip, GL_IBM_texture_mirrored_repeat,
    GL_KTX_buffer_region, GL_NV_blend_square, GL_NV_fence,
    GL_NV_fog_distance, GL_NV_light_max_exponent, GL_NV_packed_depth_stencil,
    GL_NV_pixel_data_range, GL_NV_point_sprite, GL_NV_register_combiners,
    GL_NV_texgen_reflection, GL_NV_texture_env_combine4,

GL_NV_texture_rectangle, GL_NV_vertex_array_range,
    GL_NV_vertex_array_range2, GL_NV_vertex_program, GL_NV_vertex_program1_1,
    GL_SGIS_generate_mipmap, GL_SGIS_multitexture, GL_SGIS_texture_lod,
    GL_SUN_slice_accum
glu version: 1.3
glu extensions:
    GLU_EXT_nurbs_tessellator, GLU_EXT_object_space_tess

   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x21 24 tc  0 32  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x22 24 dc  0 32  0 r  y  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x23 24 tc  0 32  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x24 24 tc  0 32  0 r  .  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x25 24 tc  0 32  0 r  .  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x26 24 tc  0 32  0 r  y  .  8  8  8  0  4 16  0 16 16 16 16  0 0 None
0x27 24 tc  0 32  0 r  y  .  8  8  8  8  4 16  0 16 16 16 16  0 0 None
0x28 24 tc  0 32  0 r  .  .  8  8  8  0  4 16  0 16 16 16 16  0 0 None
0x29 24 tc  0 32  0 r  .  .  8  8  8  8  4 16  0 16 16 16 16  0 0 None
0x2a 24 tc  0 32  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x2b 24 tc  0 32  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x2c 24 tc  0 32  0 r  .  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x2d 24 tc  0 32  0 r  .  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x2e 24 dc  0 32  0 r  y  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x2f 24 dc  0 32  0 r  .  .  8  8  8  0  4 24  8 16 16 16 16  0 0 None
0x30 24 dc  0 32  0 r  .  .  8  8  8  8  4 24  8 16 16 16 16  0 0 None
0x31 24 dc  0 32  0 r  y  .  8  8  8  0  4 16  0 16 16 16 16  0 0 None
0x32 24 dc  0 32  0 r  y  .  8  8  8  8  4 16  0 16 16 16 16  0 0 None
0x33 24 dc  0 32  0 r  .  .  8  8  8  0  4 16  0 16 16 16 16  0 0 None
0x34 24 dc  0 32  0 r  .  .  8  8  8  8  4 16  0 16 16 16 16  0 0 None
0x35 24 dc  0 32  0 r  y  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x36 24 dc  0 32  0 r  y  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
0x37 24 dc  0 32  0 r  .  .  8  8  8  0  4  0  0 16 16 16 16  0 0 None
0x38 24 dc  0 32  0 r  .  .  8  8  8  8  4  0  0 16 16 16 16  0 0 None
Offline mabraham

Junior Member





« Reply #14 - Posted 2006-01-10 10:22:28 »

You should have said you're running on Linux.  In this case your texture format probably wants to be GL_RGBA instead of GL_BGRA, you need to play with it.  Also I notice your Linux driver is quite old (66.34) I recommend you upgrade to the latest WHQL driver for Quadro boards which I think is 81.56 or something (check out at their web site).  In any case you will need a pretty recent Quadro to achieve 25ms.  I tried it under Windows on a 980XGL (ca 3 years old) and I get around 32ms.  Also before I had upgraded the drivers, I was running some 71.x drivers and the performance was a lot worse.  Another thing to check is what performance you get with non-PBO texture updates.
Offline dvgarun

Senior Newbie





« Reply #15 - Posted 2006-01-17 13:45:17 »

Hi
Planing to buy following card on Linux .

Quadro FX 4500 Memory Size
Memory Interface
Graphics Memory Bandwidth
Graphics Bus 512MB
256-bit
33.6GB/sec.
PCI Express

Pls let me know if some one already using this card  ,which will enable to get good performance for PBO .
Offline dvgarun

Senior Newbie





« Reply #16 - Posted 2006-01-18 10:12:56 »

Hi Mabraham /Ken

OS: LINUX

With PBO and GL_BGRA_

 width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.2 NVIDIA 66.34
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro NVS/AGP/SSE2
usePBO true
GLEventHandler.init(): streaming texture image using PBO
GLEventHandler.159.64706GLEventHandler.2
GLEventHandler.161.588234GLEventHandler.2
GLEventHandler.161.764706GLEventHandler.2
GLEventHandler.161.82353GLEventHandler.2
GLEventHandler.162.117645GLEventHandler.2
GLEventHandler.162.117645GLEventHandler.2
GLEventHandler.162.35294GLEventHandler.2
GLEventHandler.162.8125GLEventHandler.2


NO  PBO and GL_BGRA_


width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.2 NVIDIA 66.34
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro NVS/AGP/SSE2
usePBO false
GLEventHandler.init(): updating texture image using glTexSubImage2D()
GLEventHandler.154.94737GLEventHandler.2
GLEventHandler.151.6GLEventHandler.2
GLEventHandler.151.7GLEventHandler.2
GLEventHandler.153.473682GLEventHandler.2
GLEventHandler.157.72222GLEventHandler.2
GLEventHandler.158.11111GLEventHandler.2


WITH PBO and GL_RGBA
width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.2 NVIDIA 66.34
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro NVS/AGP/SSE2
usePBO true
GLEventHandler.init(): streaming texture image using PBO
GLEventHandler.1506.0GLEventHandler.2
GLEventHandler.1884.0GLEventHandler.2
GLEventHandler.1882.5GLEventHandler.2
GLEventHandler.1887.5GLEventHandler.2
GLEventHandler.1877.5GLEventHandler.2
GLEventHandler.1885.0GLEventHandler.2


NO PBO and GL_RGBA
width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.2 NVIDIA 66.34
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro NVS/AGP/SSE2
usePBO false
GLEventHandler.init(): updating texture image using glTexSubImage2D()
GLEventHandler.155.31579GLEventHandler.2
GLEventHandler.151.5GLEventHandler.2
GLEventHandler.151.25GLEventHandler.2
GLEventHandler.151.25GLEventHandler.2
GLEventHandler.151.85GLEventHandler.2
GLEventHandler.152.05GLEventHandler.2
GLEventHandler.151.95GLEventHandler.2



One more thing is On my LINUX machine  gl.isExtensionAvailable( "GL_ARB_pixel_buffer_object" )     false
And gl.isExtensionAvailable( "GL_EXT_pixel_buffer_object" ) true
 Is this makes any difference in performance

Or only option left move to new GPU card.
pls let me know .

Thanks
Offline Ken Russell

JGO Coder




Java games rock!


« Reply #17 - Posted 2006-01-19 02:05:44 »

Your drivers are severely outdated. Download a new set from www.nvidia.com.
Offline mabraham

Junior Member





« Reply #18 - Posted 2006-01-21 10:35:38 »

Hi
Planing to buy following card on Linux .

Quadro FX 4500 Memory Size
Memory Interface
Graphics Memory Bandwidth
Graphics Bus 512MB
256-bit
33.6GB/sec.
PCI Express

Pls let me know if some one already using this card  ,which will enable to get good performance for PBO .


Hi,

That card should be very fast.  I obviously can't promise anything as I don't own such an expensive thing.  I reckon my 7800GT is somewhat slower than the Quadro 4500, and it manages to stream 2048x2048 textures at 16ms.  It all depends on your setup however, as Ken and I have pointed out please do update your drivers.  The latest Quadro WHQL drivers are 81.67 and they boost PBO performance a lot, compared to any older drivers.

On a side note, GL_EXT_pixel_buffer_object or GL_ARB_pixel_buffer_object should make no difference (I believe the code checks for the presence of either).

One more thing regarding performance: obviously streaming textures involves a read from system memory.  That may be the bottleneck, what RAM subsystem do you use.  Maybe you could post details of your system spec here...
Offline dvgarun

Senior Newbie





« Reply #19 - Posted 2006-01-24 10:02:06 »

Hi Mabraham /Ken
I upgraded my driver to NVIDIA 81.78.But still i performance are in 3 digit .

Here the Linux Machine Details and new readings on 81.78


Machine Info :
Linux  2.6.9-1.667smp #1 SMP Tue Nov 2 14:59:52 EST 2004 i686 i686 i386 G NU/Linux
2GB RAM
4GB SWAP
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: Quadro4 980 XGL/AGP/SSE2
OpenGL version string: 1.5.5 NVIDIA 81.78


MemoryInfo :
MemTotal:      2072312 kB
MemFree:        159148 kB
Buffers:        215724 kB
Cached:        1095700 kB
SwapCached:         16 kB
Active:         673636 kB
Inactive:       759548 kB
HighTotal:           0 kB
HighFree:            0 kB
LowTotal:      2072312 kB
LowFree:        159148 kB
SwapTotal:     4152792 kB
SwapFree:      4152652 kB
Dirty:               4 kB
Writeback:           0 kB
Mapped:         161044 kB
Slab:           456672 kB
Committed_AS:   421160 kB
PageTables:       3824 kB
VmallocTotal:  2039800 kB
VmallocUsed:     26804 kB
VmallocChunk:  2008052 kB
HugePages_Total:     0
HugePages_Free:      0
Hugepagesize:     2048 kB

CPU INFO :
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz
stepping        : 9
cpu MHz         : 2659.140
cache size      : 512 KB
physical id     : 0
siblings        : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 5242.88

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 2
model name      : Intel(R) Xeon(TM) CPU 2.66GHz
stepping        : 9
cpu MHz         : 2659.140
cache size      : 512 KB
physical id     : 0
siblings        : 1
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 2
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr




WITH PBO :
width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.5 NVIDIA 81.78
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro4 980 XGL/AGP/SSE2
ARB true
EXT true
usePBO true
GLEventHandler.init(): streaming texture image using PBO
GLEventHandler.135.75GLEventHandler.2
GLEventHandler.125.375GLEventHandler.2
GLEventHandler.125.425GLEventHandler.2
GLEventHandler.126.02564GLEventHandler.2
GLEventHandler.125.425GLEventHandler.2
GLEventHandler.125.375GLEventHandler.2


NO PBO:
width 2048
hiegth 2048
GLEventHandler.init(): GL_VERSION = 1.5.5 NVIDIA 81.78
GLEventHandler.init(): GL_VENDOR = NVIDIA Corporation
GLEventHandler.init(): GL_RENDERER = Quadro4 980 XGL/AGP/SSE2
ARB true
EXT true
usePBO false
GLEventHandler.init(): updating texture image using glTexSubImage2D()
GLEventHandler.159.411766GLEventHandler.2
GLEventHandler.145.260868GLEventHandler.2
GLEventHandler.145.04348GLEventHandler.2
GLEventHandler.145.086956GLEventHandler.2
GLEventHandler.145.391304GLEventHandler.2
GLEventHandler.145.954544GLEventHandler.2

and java version jdk-1_5_0_06-linux-i586    --Xmx512m and do i have to pass any extra VM parameters ?
Pls Can you suggest what else i can do to get good peformance .
Offline dvgarun

Senior Newbie





« Reply #20 - Posted 2006-02-02 09:31:02 »

Hi Mabraham /Ken
 I didn't get any reply for below post pls can anyone reply .

Offline mabraham

Junior Member





« Reply #21 - Posted 2006-02-05 21:33:39 »

I didn't reply because I'm running out of ideas...  Undecided

Your hardware is very similar to one of my machines (dual Xeon with a Quadro 980XGL), and if I remember correctly, running my 1024x1024 texture demo I got ca 7ms and 14ms with and without using PBOs, respectively.  This should scale quadratically with the tex dimensions i.e. I would expect around 30ms and 55ms for a 2048x2048 texture.  The difference of 25ms between those last two figures actually compares to the difference between the timings you obtained on your system, which makes me suspect that something else consumes the remaining 90-odd milliseconds.  Therefore, can you please take my original code with the 1024x1024 texture and run that.  Also, what is your display configuration?  You need to make sure your desktop is set to a 24-bit (32-bit??) colour depth.  Do not set it to 16-bit.  One more thing, you need to disable VSYNC for benchmarking, otherwise your timings will be a multiple of your monitor's refresh rate (although that would not account for the poor performance).  The NVIDIA Linux driver manual might tell you how to disable VSYNC.
Offline dvgarun

Senior Newbie





« Reply #22 - Posted 2006-02-07 12:32:36 »

Hi

Started from fresh and now I am able to get around 30 ms with PBO.Thx lot your support.
I think while wrapping the BuffereData I was doing wrong .

Now I want to zoom this image
I used following API but image didn't zoomed any other API I have to look in ...
       // Zoom
      gl.glLoadIdentity();
      gl.glTranslatef(-15.0f,-15.0f,0.0f);
Pls can you help me out
Offline mabraham

Junior Member





« Reply #23 - Posted 2006-02-07 22:17:39 »

Congrats on getting good performance!  I think 30ms is the best you can expect from your 980XGL, around 530MB/sec throughput.  A modern QuadroFX 4500 can do as much as 2.6GB/sec though, according to http://developer.nvidia.com/object/fast_texture_transfers.html, which should accelerate your timings substantially.

Regarding your question how to zoom the image, there would be several options, but certainly not applying a translation to whatever is your current matrix.  If all you want to do is to zoom into the image then for instance you could adjust the texture coordinates when drawing the primitive, or transform your model (eg. http://www.rush3d.com/reference/opengl-bluebook-1.0/ch05.html#id5531421).  Either way you can achieve panning, zooming, and even rotating or mirroring your image, at virtually no loss in speed.

You should probably start to read a good book on computer graphics and OpenGL.  I'd also recommend the discussion forums hosted at opengl.org, specifically http://www.opengl.org/discussion_boards/cgi_directory/ultimatebb.cgi?ubb=forum;f=2.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Riven (7 views)
2014-07-29 12:53:52

Dwinin (7 views)
2014-07-29 10:59:34

E.R. Fleming (23 views)
2014-07-29 03:07:13

E.R. Fleming (9 views)
2014-07-29 03:06:25

pw (39 views)
2014-07-24 01:59:36

Riven (39 views)
2014-07-23 21:16:32

Riven (26 views)
2014-07-23 21:07:15

Riven (28 views)
2014-07-23 20:56:16

ctomni231 (59 views)
2014-07-18 06:55:21

Zero Volt (51 views)
2014-07-17 23:47:54
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!