Alpha and line thickness in ofVbo?

Hi,

I’ve written some code to draw a bunch of lines using ofVbo. Now I’d like to control the thickness and alpha of these lines but I can’t figure out how.

I’ve set the alpha value of the ofFloatColors I’m using but this doesn’t have any effect.

Any suggestions?

Thanks!

After a long search I found some clues in oF’s source code, which worked :slight_smile:

  
  
	glPushAttrib(GL_COLOR_BUFFER_BIT | GL_ENABLE_BIT);  
  
	glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);  
	glEnable(GL_LINE_SMOOTH);  
	  
	glEnable(GL_BLEND);  
	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);  
  

But am I missing something or is there really no normal documentation on this?

You can set ofEnableAlphaBlending() to make sure the lines have the ability to draw with alpha enabled.
The thickness of the lines can be set by using glLineWidth( 10.f );

The thickness of the individual lines can not be set because the information is already loaded into the gpu. If you want to set the thickness of the lines individually, then you will have to construct the lines yourself with vertices.
ofVboMesh might be helpful for this.

Thanks a lot for your help!

Is there anywhere I can get more documentation on these GL-related things. I guess more questions will pop up soon.

NeHe is a good place for openGL tutes
http://nehe.gamedev.net/

Browsing through the OF source code is also a good start. Especially ofMesh, ofVboMesh, and ofGLRenderer

Thanks!