Here is a comparison taken from the OpenGL Intro Lab
- drawing a single triangle to the screen. The stand alone
scripts are attached. Timings are taken on the 4th or 5th
run after convergence.

The main difference in timing is between
glaSwapBuffers (j504) and
draw__ogl (j601)
with j504 being more than 3 times faster.

NB. j504b
  time 'a_run 0'
0.0294568
  T,Td,T-Td
0.000180854 0.000121942 5.89121e_5

NB. j601mbeta
  time 'gl3lab_run 0'
0.00868553
  T,Td,T-Td
0.000525283 0.000447014 7.82687e_5

Steve



NB. j504 script #####################################
NB. ogl3.ijs
require 'opengl gl2 gl3'
coinsert 'jgl2 jgl3'

time=:6!:2

a_g_paint =: 3 : 0
T_base_=: time 'paint 0'
)


paint =: verb define
glClearColor 0 0 1 0
glClear GL_COLOR_BUFFER_BIT
drawtriangle ''              NB. draw triangle
Td_base_=: time'glaSwapBuffers '''''
)

drawtriangle =: verb define
glColor 1 0 0 0              NB. RBGA red
glBegin GL_POLYGON           NB. define polygon (triangle)
glVertex  1 0 0
glVertex  0 1 0
glVertex _1 0 0
glEnd ''
)

A=: 0 : 0
pc a closeok;
xywh 0 0 100 100;cc g isigraph ws_clipchildren ws_clipsiblings rightmove bottommove;
pas 0 0;
rem form end;
)

a_run=: 3 : 0
wd :: ] 'psel a;pclose'
wd A
glaRC ''
wd 'pshow;ptop'
)

NB. j601mbeta script #####################################
require 'opengl gl2 gl3'
coinsert 'jgl2 jgl3'

time=:6!:2

GL3LAB=: 0 : 0
pc gl3lab closeok;
xywh 0 0 100 100;cc g isigraph rightmove bottommove;
pas 0 0;
rem form end;
)

gl3lab_run=: 3 : 0
wd GL3LAB
ogl=: ''conew'jzopengl'
gl3lab_g_paint''
wd'pshow;'
)

gl3lab_g_paint=: 3 : 0
alloc__ogl wh=. glqwh''
T_base_ =: time 'paint 0'
)

paint    =: 3 : 0
NB. alloc__ogl wh=. glqwh''
glClearColor 0 0 1 0
glClear GL_COLOR_BUFFER_BIT
glOrtho _1 1 _1 1 _1 1
glColor3d 0 0 0
glBegin GL_POLYGON
glVertex 1  ,0  ,0,1
glVertex 0  ,1  ,0,1
glVertex _1 ,0  ,0,1
glEnd ''
Td_base_=: time 'draw__ogl'''''
)
NB.###########################################
Chris Burke wrote:
Steven Phillips wrote:
For the "OpenGL Graphics" example in the OpenGL demo, rotation of the text
was about twice as slow in j601mbeta (about 55s for 10 rotations) than
j504b (35s for 10 rotations). The OpenGL window was resized in j601m
to be the same size as the default in j504b.

I am not sure these are good comparisons - the demos may look the same,
but very likely have code differences that affect their performance,
other than changes to the underlying opengl. For example, I believe the
demos are slowed down from the originals, to allow for faster machines.

A better test is to construct a scene from scratch, in both J5 and J6,
ensuring that the code is the same other than for the underlying opengl,
and then compare the drawing times.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to