I've been trying to achieve this effect
and to do that I created a quad to which I apply a material which is supposed to attach a ring texture (i.e. a transparent texture containing a ring which fades on the inside and the outside) and color the non transparent area (i.e. pixel of the texture with a not nil alpha value) thanks to the color values attached to each vertex of the quad.
In the end it should a ring of gradient.
Here is the code for the material, which is supposed to achieve this but is only making the quad completely transparent.
Code: Select all
material Sun/Test
{
technique
{
pass 3
{
texture_unit
{
texture ring.png
}
scene_blend alpha_blend
ambient vertexcolour
depth_write off
depth_check on
}
}
}
Code: Select all
atmosphereEffectNode = static_cast<SceneNode*>(sceneManager->getRootSceneNode()->createChild());
ManualObject* atmosphereQuad = sceneManager->createManualObject("AtmosphereEffect"); atmosphereQuad->begin("Sun/Test",RenderOperation::OT_TRIANGLE_STRIP);
atmosphereQuad->position(Vector3(-2,-2,-1.1));
atmosphereQuad->colour(Ogre::ColourValue::Red);
atmosphereQuad->position(Vector3(-2,2,-1.1));
atmosphereQuad->colour(Ogre::ColourValue::Red);
atmosphereQuad->position(Vector3(2,-2,-1.1));
atmosphereQuad->colour(Ogre::ColourValue::Blue);
atmosphereQuad->position(Vector3(2,2,-1.1));
atmosphereQuad->colour(Ogre::ColourValue::Black);
atmosphereQuad->setVisible(true);
atmosphereQuad->end();
atmosphereEffectNode->attachObject(atmosphereQuad);
Having studied the manual concerning the texture and the pass options I thought I knew how the material scripts worked but I must admit that I'm totally confused now
Could someone help me on this one, please?