Category Archives: VISIBILITY

Phil 3.5.12

8:00 – 9:30 VISIBILITY

  • Checking up on email, trying to get access to the presentation slides for the demo, etc. I won’t steal Mikes thunder about progress with getting VISIBILITY swfs running

9:30 – 4:30 FP

  • Advanced Shaders (Chapter 11)
    • Geometry shaders run once per primitive. This means that it’ll run once per point for GL_POINTS; once per line for GL_LINES, GL_LINE_STRIP, and GL_LINE_LOOP; and once per triangle for GL_TRIANGLES, GL_TRIANGLE_STRIP, and GL_TRIANGLE_FAN.
    • GL_LINES_ADJACENCY, GL_LINE_STRIP_ADJACENCY, GL_TRIANGLES_ADJACENCY, and GL_TRIANGLE_STRIP_ADJACENCY allow the geometry shader to get at the vertices that are adjacent to the particular piece of geometry that we’re interested in. I’d assume  that we can also manipulate those pieces, though I’m not sure that’s a good idea.
    • Convolution filters can be generated as a texture (even an image), and then used to modify what’s being rendered. For example, the following should be usable as a blur filter, assuming that the weights add up to 1.0 (which could be done as a pre-processing pass on the data before the texture is made):
    • Got the demo that uses a fragment shader to draw a Julia Set kind of working.
    • Tried to start Uniform Buffer Objects, but discovered that my brain was full.

Mike 3.2.12

  • Usual daily server and DB backups
  • Tested the rebuilt versions of ConnectionTest and Visibility, no good
  • Lots of emails inside to keep me busy doing non-development
  • Back at the office I am trying to match all compiler and library settings between PPM and Visibility as much as possible
  • Moved a copy of AccountManagers to the PPM project and compiled it
  • Copied some of the Visibility Documentation to a CD so I can answer some of the questions from curious people inside more quickly

Phil 3.2.12

8:30 – 1:30 FP

  • Really good page: http://www.opengl.org/wiki/Common_Mistakes
  • Advanced buffers – done
  • Fragment operations (Chapter 10)
    • Order-independent transparency using multisample buffers. Looks pretty straightforward. Need to add that. Possibly to ScreenRepaint?
  • Advanced Shader Usage (Chapter 11)
    • Physical simulation, such as meshes. Should be nice for network visualization…
  • Found the reason for why screenwidth must be a multiple of 4 (from http://www.opengl.org/wiki/Common_Mistakes#Texture_upload_and_pixel_reads):
  • Texture upload and pixel reads

    You create a texture and upload the pixels with glTexImage2D (or glTexImage1D, glTexImage3D). However, the program crashes on upload, or there seems to be diagonal lines going through the resulting image. This is because the alignment of each horizontal line of your pixel array is not multiple of 4. That is, each line of your pixel data is not a multiple of 4. This typically happens to users loading an image that is of the RGB or BGR format (in other words, 24 bpp image).
    Example, your image width = 401 and height = 500. The height doesn’t matter. What matters is the width. If we do the math, 401 pixels x 3 bytes = 1203. Is 1203 divisible by 4? In this case, the image’s data alignment is not 4. The question now is, is 1203 divisible by 1? Yes, so the alignment is 1 so you should call glPixelStorei(GL_UNPACK_ALIGNMENT, 1). The default is glPixelStorei(GL_UNPACK_ALIGNMENT, 4). Unpacking means sending data from client side (the client is you) to OpenGL.
    And if you are interested, most GPUs like chunks of 4 bytes. In other words, RGBA or BGRA is prefered. RGB and BGR is considered bizarre since most GPUs, most CPUs and any other kind of chip don’t handle 24 bits. This means, the driver converts your RGB or BGR to what the GPU prefers, which typically is BGRA.
    Similarly, if you read a buffer with glReadPixels, you might get similar problems. There is a GL_PACK_ALIGNMENT just like the GL_UNPACK_ALIGNMENT. The default GL_PACK_ALIGNMENT is 4 which means each horizontal line must be a multiple of 4 in size. If you read the buffer with a format such as BGRA or RGBA you won’t have any problems since the line is already a multiple of 4. If you read it in a format such as BGR or RGB then you risk running into this problem.
    The GL_PACK_ALIGNMENT can only be 1, 2, 4, or 8. So an alignment of 3 is not allowed. You could just change the GL_PACK_ALIGNMENT to 1. Or you can pad your buffer out so that each line, even with only 3 values per pixel, is a multiple of 4.

     

 

Mike 3.1.2012

  • Usual server and DB backups
  • Imported a new version of the connection tester application built with different libraries, it works!  Now I need to figure out the differences.
  • Got status back on my Flash Builder request, i am still on the wait list
  • Compiling Feb status reports for the team
  • Had some issues with my internal email client, contacted EA and got it resolved
  • Still trying to work out issues applying patches to the site server, got directions to submit an EA ticket and submitted one
  • Dong found some sdk differences in the builds so I will test changing them to match PPM
  • Flex builder was apparently using libraries from 2 different SDKs for visiblity, account managers, and ingest manager (one dictated by maven and one by flex builder).  So i went through and remove one of them and rebuilt them.  They work on my local machine but that’s not promise the problem is fixed.
  • Also made a build of each using purely maven.  Watermarks may appear but if it fixes the connectivity issues we can address the watermark problems.
  • Hudson is still running on fgmdev.com but all the assigned builds got wiped out 😦  I added the vis data nav application and it built fine.  I probably won’t add the others but it’s always an option.
  • Hudson admin seems to be open to anyone as I didn’t have to log in, so either the builds were lost during the transfer of servers or some kind individual did some housekeeping for us.

Phil 3.1.12

8:30 – 10:30 VISIBILITY

  • Set up the root index page to point at working versions of the VISIBILITY system until we get everything working on one server.
  • Asked for the slides to the meeting yesterday. I’m thinking about using it to set up the slideshow for the demo.
  • Pinged Laurie about getting date information so that I can finish submitting my forms.

10:30 – 12:30 FP

  • Back to reading through the screen buffers chapter.

12:30 – 2:30 interview

2:30 – 4:30 FP

  • Some reading, some walking through the circuit board design with Tom

Dong Shin 03.01.2012

  • Feb 2012 Status
    • Bug Fixes
      • Fixed Auto-fill not working in Financial Data Entry
      • Fixed Contacts not populating properly in Funding Request
      • Fixed Project Assistant not showing correct status
    • deployment
      • assist in deployment of Project Portfolio Manager/Project Assistant
      • built new Visibility and VisibilityScripting for demo
      • trouble-shooting Visibility deployment issues
    • reverse engineeered Project Portfolio database to use in GWT/Spring using Spring Roo and Hibernate Tools
    • Struts/Spring/Hibernate training
    • working on Project Portfolio Manager and Project Assistant using GWT/Spring

Mike 2.29.2011

  • Usual server and database back up in the morning
  • Reproduced the server environment on my local machine at site, ended up getting the same errors, so I will at least have a better working environment than on the ‘production’ system
  • Attempted installing a working version of Visibility from Jeff’s sever, same issue
  • Contacted Jim and Tangie regarding internal testing of our tool, waiting to hear back
  • Contacted the software people regarding my request for Flash Builder, would be very handy right now
  • Went back to the office to rebuild my connection tester using different libraries
  • Also packing up other parts of my Tomcat Install to bring: crossdomain.xml, etc.
  • ISP PMO Symposium, 1300-1500

Phil 2.29.12

8:30 – 11:00, 12:30 – 3:00 VISIBILITY

  • Worked on getting Data Visualization working
  • ISR/PMO meeting from 1:00 – 3:00

11:00 – 12:30, 3:00 – 5:00 FP

  • Working on multiple rendering surfaces. For the trivial case, I’m going to try to take the blurred image and invert the colors.
  • Added definition of the vertex and fragment shaders in the ScreenRepaint class, since it’s pretty generic.
  • Took screen rendering out of the Gl_ShaderWindow base class and added two instances to the GeoTestShaderWindow. Everything works just as it should.
  • Meeting at UMBC on surface displays, journals and other things. Looks like I’m on a team to build a “Surface-style” interface for the visually impaired. Meetings are every Wednesday at 4:30

Mike 2.28.2012

  • Did the normal database backup this morning
  • Deployed a test client application to test remote object connectivity for Visibility on the client server
    • It reads all properties for the properties file just fine
    • It does NOT produce any errors while attempting to connect to the remote object, however it does not succeed either
    • There no errors indicating anything went wrong in any log files anywhere
  • Responded to several emails concerning the server going down yesterday
    • Apparently as soon as I submitted a ticket it was restarted which is what fixed the issue
    • The tech sent me an email at 9:40 when the server came up, my email server received the email two hours later…
  • Back at the office I tried debugging several items to figure out why Visibility is failing on the inside
  • Dong built a version of visibility which I will take back to try and debug
  • I will also try stopping and restarting the Tomcat server
  • Went back to site and tested the fixes, they did not help

Mike 2.27.2011

  • Imported a fresh build of Visibility
  • The server was down when I got to the customer site this morning.  I contacted someone who Phil suggested as well as the EDC support center.  The system came back up around 9:40 AM without word from anyone.
  • Deployed the new visibility, still not able to log in with the data navigator or the account managers tools.
  • Reviewed required server updates from Denise.  Tried to apply several but got errors.  Asked Denise who to contact.
  • Tried to listen to the FGM all hands meeting recording, doesn’t appear to be uploaded correctly
  • Created a debugging application to try and figure out why visibility isn’t working at site
  • Working on a “Home” page for the vis tool which will act as a launchpad for PPM, PPA, and the data visualizations

Phil 2.24.12

8:30 – FP

  • I think I found GLSL documentation! http://www.opengl.org/sdk/docs/manglsl/
  • A working convolution filter that blurs anything above a certain luminance:
  • #version 150
    // glow.fs
    // outputs the color negative of a texture
    //
    
    in vec2 vTexCoord;
    
    uniform int screenWidth;
    uniform int screenHeight;
    
    uniform sampler2D textureUnit0;
    
    vec4 getTexOffset(const sampler2D texUnit, const vec2 texCoord, const float dx, const float dy){
    	vec2 offset = texCoord + vec2(dx, dy);
    	return texture(textureUnit0, offset);
    }
    
    void main(void)
    {
    	float dx = 1.0 / float(screenWidth);
    	float dy = 1.0 / float (screenHeight);
    
    	float x;
    	float y;
    	vec4 blurSum = vec4(0, 0, 0, 0);
    	float patchSize = 4.0;
    	float xmin = -patchSize*dx;
    	float xmax = patchSize*dx+dx*0.5;
    	float ymin = -patchSize*dy;
    	float ymax = patchSize*dy+dx*0.5;
    	float count = 0;
    
    	for(x = xmin; x < xmax; x += dx){
    		for(y = ymin; y < ymax; y += dy){
     			blurSum += getTexOffset(textureUnit1, vTexCoord, x, y);
     			if(count > 1000){
    				discard;
    			}
    			count += 1.0;
    		}
    	}
    	float weight = 1.0/count;
    	vec4 blured = vec4(blurSum.r*weight, blurSum.g*weight, blurSum.b*weight, 1.0);
    	vec4 sharp = texture(textureUnit0, vTexCoord);
    
    	float luminance = blured.r + blured.g + blured.b;
    	if(luminance > 1.0){
    		gl_FragColor = blured;
    	}else{
    		gl_FragColor = sharp;
    	}
    }
  • And here’s the picture it produces. Note the sharp moon and gridlines with the blurry sun 🙂
  • Next on the hit parade, add a test to see if the corners of the convolution filter touch anything above the luminance threshold and discard if it doesn’t. My guess is that should speed up things a lot. Done. Discovered that there are some odd problems that crop up as the screen gets made quite large. This could have something to do with the fact that I’m not checking to see that the convolution patch’s coordinates can run off the texture (i.e not clamped between 0.0 and 1.0)?
  • Migrate the screen drawing to a DrawableObject class. I’m pretty sure it should work there, as long as it’s called after postDraw3D(). In fact, it should be possible to have multiple screen drawing classes, though I’m not sure why.
  • Add shader directory to svn repo – done
  • And it appears that after a while, something is clogging the graphics pipeline, because the drawing slows way done. This does look like it’s due to the shader, as the neg.fs doesn’t seem to be slowing things down. Yep,  adding clamping to the glow.fs shader fixed that problem. Still have the problem where the screen texture gets messed up if the window gets too big…
  • So here’s the better version of the fragment shader
  • #version 150
    // glow.fs
    // outputs the color negative of a texture
    //
    
    in vec2 vTexCoord;
    
    uniform int screenWidth;
    uniform int screenHeight;
    
    uniform sampler2D textureUnit0;
    
    void luminanceTest(const sampler2D texUnit, const vec2 texCoord, const float xmin, const float xmax, const float ymin, const float ymax, const float luminance){
    	vec2 ll = clamp(texCoord + vec2(xmin, ymin), 0.0, 1.0);
    	vec2 lr = clamp(texCoord + vec2(xmax, ymin), 0.0, 1.0);
    	vec2 ur = clamp(texCoord + vec2(xmax, ymax), 0.0, 1.0);
    	vec2 ul = clamp(texCoord + vec2(xmin, ymax), 0.0, 1.0);
    
    	vec4 total = texture(texUnit, ll);
    	total += texture(texUnit, lr);
    	total += texture(texUnit, ur);
    	total += texture(texUnit, ul);
    
    	float weight = 1.0/4.0;
    	float val = (total.r + total.g + total.b)*weight;
    	if(val < luminance){
    		discard;
    	}
    }
    
    vec4 getTexOffset(const sampler2D texUnit, const vec2 texCoord, const float dx, const float dy){
    	vec2 offset = texCoord + vec2(dx, dy);
    	clamp(offset, 0.0, 1.0);
    	return texture(texUnit, offset);
    }
    
    void main(void)
    {
    	float dx = 1.0 / float(screenWidth);
    	float dy = 1.0 / float (screenHeight);
    
    	float x;
    	float y;
    	vec4 blurSum = vec4(0, 0, 0, 0);
    	float patchSize = 4.0;
    	float xmin = -patchSize*dx;
    	float xmax = patchSize*dx+dx*0.5;
    	float ymin = -patchSize*dy;
    	float ymax = patchSize*dy+dx*0.5;
    	float count = 0;
    
    	luminanceTest(textureUnit0, vTexCoord, xmin, xmax, ymin, ymax, 1.0);
    
    	for(x = xmin; x < xmax; x += dx){
    		for(y = ymin; y < ymax; y += dy){
     			blurSum += getTexOffset(textureUnit0, vTexCoord, x, y);
     			if(count > 1000){
    				discard;
    			}
    			count += 1.0;
    		}
    	}
    	vec4 sharp = texture(textureUnit0, vTexCoord);
    	float weight = 1.0/count;
    	vec4 blured = vec4(blurSum.r*weight, blurSum.g*weight, blurSum.b*weight, sharp.a);
    
    	float luminance = blured.r + blured.g + blured.b;
    	if(luminance > 1.0){
    		gl_FragColor = blured;
    	}else{
    		gl_FragColor = sharp;
    	}
    }

Mike 2.24.2012

  • Normal database backup and connectivity testing
  • Brought in a version of Visibility and Visibility Scripting
  • Reviewed some of the required updates from Denise
  • Worked with Dong to try and deploy Visibility and Visibility Scripting
    • Visibility Scripting is working after fixing some errors in the properties file
    • Visibility doesn’t seem to be correctly reading the properties file, not sure what they error is but the swf is from July 2011 so I will try building a new one and bringing that one in
  • Rebuilt IngestManager and AccountManagers
  • Attempting to Build PPM and PA:
    • Project Assistant built fine and I imported Dong’s database of fake data
    • PPM is having remote object problems

Mike 2.23.2012

  • Regular back up and connectivity checks this morning
  • Deployed a fix for a broken user select button in the Create Funding Request dialog
  • Met with Tangie and discussed:
    • Connectivity through outside networks
    • Getting a link to our stuff from a more official site
    • Difficulties creating a funding request, Tangie was able to while I was watching but we’re still trying to get a hold of Christina and diagnose her difficulties
  • Contacted Denise Price regarding server maintenance, she said she would email me the details
  • Contacted the authentications server helpdesk to try and get our system added to the production list from the test list
  • Brought Dong up to speed about yesterday’s meeting
  • Working on building a fresh version of Visibility, PPM, and PA on my laptop
    • Need to find / install a flex 3.5 SDK
    • Need my Eclipse to cooperate and quit locking up
    • Got it built!