Changeset 377


Ignore:
Timestamp:
Mar 25, 2006, 12:37:21 PM (19 years ago)
Author:
qiaow
Message:

Added PerfQuery? class for tracking number of pixels rendered on screen

Location:
trunk/gui/vizservers/nanovis
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/vizservers/nanovis/Makefile

    r373 r377  
    11OBJ_NANOVIS = nanovis.o Socket.o RenderVertexArray.o Plane.o ConvexPolygon.o Vector4.o Vector3.o Mat4x4.o \
    2                 Texture1D.o Texture3D.o ColorMap.o Volume.o Texture2D.o ParticleSystem.o Sphere.o Color.o
     2                Texture1D.o Texture3D.o ColorMap.o Volume.o Texture2D.o ParticleSystem.o Sphere.o Color.o \
     3                PerfQuery.o
    34
    45AUXSRC = config.h define.h global.h
     
    6768        gcc $(CFLAG) ConvexPolygon.cpp
    6869
     70PerfQuery.o: PerfQuery.cpp
     71        gcc $(CFLAG) PerfQuery.cpp
     72
    6973nanovis.o: nanovis.h nanovis.cpp ParticleSystem.o $(AUXSRC)
    7074        gcc $(CFLAG) nanovis.cpp
  • trunk/gui/vizservers/nanovis/global.h

    r273 r377  
    5656}
    5757
     58
     59//query opengl information
     60static void system_info(){
     61  fprintf(stderr, "-----------------------------------------------------------\n");
     62  fprintf(stderr, "OpenGL driver: %s %s\n", glGetString(GL_VENDOR), glGetString(GL_VERSION));
     63  fprintf(stderr, "Graphics hardware: %s\n", glGetString(GL_RENDERER));
     64  fprintf(stderr, "-----------------------------------------------------------\n");
     65}
     66
     67
    5868#endif
  • trunk/gui/vizservers/nanovis/nanovis.cpp

    r375 r377  
    3838ColorMap* colormap[MAX_N_VOLUMES];      //transfer functions, currently handle up to 10 colormaps
    3939
     40PerfQuery* perf;                        //perfromance counter
    4041
    4142//Nvidia CG shaders and their parameters
     
    633634void initGL(void)
    634635{
     636   system_info();
    635637   init_glew();
    636638
     
    667669   }
    668670
    669    //init_vector_field();       //3d vector field
    670    load_volume_file(0, "./data/A-apbs-2-out-potential-PE0.dx");
     671   //check if performance query is supported
     672   if(check_query_support()){
     673     //create queries to count number of rendered pixels
     674     perf = new PerfQuery();
     675   }
     676
     677   init_vector_field(); //3d vector field
     678   //load_volume_file(0, "./data/A-apbs-2-out-potential-PE0.dx");
    671679   //load_volume_file(0, "./data/nw-AB-Vg=0.000-Vd=1.000-potential.dx");
    672680   //load_volume_file(0, "./data/test2.dx");
     
    12871295
    12881296  get_near_far_z(mv, zNear, zFar);
    1289   fprintf(stderr, "zNear:%f, zFar:%f\n", zNear, zFar);
    1290   fflush(stderr);
     1297  //fprintf(stderr, "zNear:%f, zFar:%f\n", zNear, zFar);
     1298  //fflush(stderr);
    12911299
    12921300  //compute actual rendering slices
    12931301  float z_step = fabs(zNear-zFar)/n_slices;             
    12941302  int n_actual_slices = (int)(fabs(zNear-zFar)/z_step + 1);
    1295   fprintf(stderr, "slices: %d\n", n_actual_slices);
    1296   fflush(stderr);
     1303  //fprintf(stderr, "slices: %d\n", n_actual_slices);
     1304  //fflush(stderr);
    12971305
    12981306  static ConvexPolygon staticPoly;     
     
    15591567   //psys->display_vertices();
    15601568
    1561    //render volume
     1569   //render multiple volumes
    15621570   //volume[0]->location =Vector3(0.,0.,0.);
    15631571   //render_volume(0, 256);
     
    15651573   //render another but shifted using the same texture
    15661574   volume[0]->location =Vector3(-0.5,-0.5,-0.5);
     1575
     1576   perf->enable();
    15671577   render_volume(0, 256);
     1578   perf->disable();
     1579   fprintf(stderr, "pixels: %d\n", perf->get_pixel_count());
     1580   perf->reset();
    15681581
    15691582   glDisable(GL_DEPTH_TEST);
  • trunk/gui/vizservers/nanovis/nanovis.h

    r374 r377  
    4040#include "Volume.h"
    4141#include "ParticleSystem.h"
     42#include "PerfQuery.h"
    4243
    4344#include "config.h"
  • trunk/gui/vizservers/nanovis/shaders/one_volume.cg

    r374 r377  
    2525  float4 tex_coord = mul(modelViewInv, IN.TexCoord);
    2626       
    27 #if 1
     27#if 0
    2828  //1 component
    2929  float sample = tex3D(volume, tex_coord.xyz);
     
    3737
    3838
    39 #if 0
     39#if 1
    4040  //3 component
    4141  float3 sample = tex3D(volume, tex_coord.xyz).xyz;
Note: See TracChangeset for help on using the changeset viewer.