Hi,
i am new to this mailing-list, so tell me if i violate the protocol.
I am using OpenSG to create an VR-based Graffiti and one of my biggest
problems is the colored mist of the sprayed paint.
I am using Particles with Sprites to achieve a nice looking fog.
This is how i create my Sprite.
Sprite::Sprite(Pnt3f startPos)
{
//printf("Sprite:Konstruktor\n");
texImage = Image::create();
texImage->read(".\\textures\\smoke.png");
//printf("Sprite:texChunk\n");
texChunk = TextureChunk::create();
beginEditCP(texChunk);
{
//texChunk->setEnvMode(GL_BLEND);
texChunk->setMinFilter(GL_LINEAR_MIPMAP_LINEAR);
texChunk->setMagFilter(GL_LINEAR);
texChunk->setScale(false);
texChunk->setImage(texImage);
texChunk->setPointSprite(true);
}
endEditCP(texChunk);
//printf("Sprite:blendChunk\n");
blendChunk = BlendChunk::create();
beginEditCP(blendChunk);
{
blendChunk->setAlphaValue(.5);
blendChunk->setAlphaFunc (GL_LESS);
blendChunk->setSrcFactor (GL_SRC_ALPHA);
blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
}
endEditCP(blendChunk);
//printf("Sprite:pointChunk\n");
this->sSize = 10;
pointChunk = PointChunk::create();
beginEditCP(pointChunk);
pointChunk->setSprite(true);
pointChunk->setSize(sSize);
endEditCP(pointChunk);
//printf("Sprite:materialChunk\n");
material = ChunkMaterial::create();
beginEditCP(material);
material->addChunk(pointChunk);
material->addChunk(texChunk);
material->addChunk(blendChunk);
endEditCP(material);
//printf("Sprite:position\n");
position = GeoPositions3f::create();
beginEditCP(position);
position->addValue(startPos);
endEditCP(position);
//printf("Sprite:type\n");
type = GeoPTypesUI8::create();
beginEditCP(type);
type->addValue(GL_POINT);
endEditCP(type);
//printf("Sprite:size\n");
size = GeoPLengthsUI32::create();
beginEditCP(size);
size->addValue(position->getSize());
endEditCP(size);
//printf("Sprite:spriteGeo\n");
spriteGeo = Geometry::create();
beginEditCP(spriteGeo);
{
spriteGeo->setTypes(type);
spriteGeo->setLengths(size);
spriteGeo->setPositions(position);
spriteGeo->setMaterial(material);
}
endEditCP(spriteGeo);
//printf("Sprite:Konstruktor fertig\n");
}
I want to adjust the transparency of the entire sprite, with the
alpha-blending i can only infuence which alpha-values of the texture
are considered.. am i right, i am not really sure about this
mechanism, as it produces different results depending on my
graphic-hardware.
Also the pointChunk->setsize() is not really clear to me, i am using
it to change the size of the sprite, but it is limited to 1000. Why?
My last Problem is the color, do i need a material attached to the
particle holding the sprite to get color? everytime i used material
and texture together, the material-properties didn't seem to influence
the appearance anymore.
Okay, i will be happy about any kind of feedback, maybe you can
recommend some urls, since there is not much of documentation and
examples about opensg..
thanks
lars
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users