-attribute float results;
attribute float clamp;
-attribute float geomSize;
-attribute float minSize;
-attribute float maxSize;
-attribute float magnification;
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- gl_FrontColor = gl_Color;
+ gl_FrontColor.x = gl_Color.x;
+ gl_FrontColor.y = gl_Color.y;
+ gl_FrontColor.z = gl_Color.z;
- float size;
- if( results == 1 )
- size = minSize + ( maxSize - minSize ) * ( 1 - gl_Color.w / 241.0f );
- else
- size = geomSize;
-
- gl_PointSize = min( magnification * size * gl_ProjectionMatrix[0].x, clamp );
+ gl_PointSize = min( gl_Color.w * gl_ProjectionMatrix[0].x, clamp );
}
this->ListId = 0;
this->TotalCells = 0;
- this->ActorOpacity = 0;
this->ExtensionsInitialized = 0;
this->DefaultPointSize = 20.0;
else
this->ScalarVisibilityOff();
- float aResults = theResults ? 1.0 : 0.0;
-
- //cout << "SetPointSpriteResults " << this << " " << aResults << endl;
-
this->PointSpriteResults = theResults;
- //this->SetShaderVariable( "results", theMagnification );
this->Modified();
}
//-----------------------------------------------------------------------------
if( !this->ExtensionsInitialized && !this->UseOpenGLMapper )
{
this->InitExtensions();
- act->GetProperty()->SetPointSize( 1.0f );
+ act->GetProperty()->SetPointSize( 10.0f );
}
if( this->UseOpenGLMapper )
if (this->ImmediateModeRendering ||
this->GetGlobalImmediateModeRendering())
{
+ // sets this->Colors as side effect
this->MapScalars( act->GetProperty()->GetOpacity() );
// Time the actual drawing
vglUseProgramObjectARB( this->VertexProgram );
- this->SetShaderVariable( "results", this->PointSpriteResults );
- this->SetShaderVariable( "clamp", this->PointSpriteClamp );
- this->SetShaderVariable( "geomSize", this->PointSpriteSize );
- this->SetShaderVariable( "minSize", this->PointSpriteMinSize );
- this->SetShaderVariable( "maxSize", this->PointSpriteMaxSize );
- this->SetShaderVariable( "magnification", this->PointSpriteMagnification );
+ this->SetShaderVariable( "clamp", this->PointSpriteClamp );
TVertex* aVertex = new TVertex[ this->TotalCells ];
aVertex[i].g = green;
aVertex[i].b = blue;
- aVertex[i].hue = ComputeHue( ( int )( red * 255 ), ( int )( green * 255 ), ( int )( blue * 255 ) );
+ float size = 0.0;
+ if( this->PointSpriteResults )
+ {
+ float h = ComputeHue( ( int )( red * 255 ), ( int )( green * 255 ), ( int )( blue * 255 ) );
+ size = this->PointSpriteMinSize + ( PointSpriteMaxSize - PointSpriteMinSize ) * ( 1 - h / 241.0f );
+ }
+ else
+ size = this->PointSpriteSize;
+
+ aVertex[i].hue = this->PointSpriteMagnification * size;
}
GLuint aBufferObjectID = 0;
glColorPointer( 4, GL_FLOAT, sizeof(TVertex), (void*)0 );
glVertexPointer( 3, GL_FLOAT, sizeof(TVertex), (void*)(4*sizeof(GLfloat)) );
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState( GL_VERTEX_ARRAY );
+ glEnableClientState( GL_COLOR_ARRAY );
- glDrawArrays(GL_POINTS,0,this->TotalCells);
+ glDrawArrays( GL_POINTS, 0, this->TotalCells );
- glDisableClientState(GL_COLOR_ARRAY);
- glDisableClientState(GL_VERTEX_ARRAY);
+ glDisableClientState( GL_COLOR_ARRAY );
+ glDisableClientState( GL_VERTEX_ARRAY );
vglDeleteBuffersARB( 1, &aBufferObjectID );