Game Development Community

Translucent rectangle error

by Mehmet Kizil · in Torque Game Engine · 08/21/2005 (8:32 pm) · 1 replies

Hey guys, i've done alot of work on a particular program in terms of physics and algorithm development and now its time to wack it all on screen. I've set up a translucent rectangle through Melv's fxRenderObject. Changed glColor4f so that it is translucent, also image->isTranslucent = true;. and made the blend mode with an alpha channel. Now when I run the program to see whats happening I can move around the object (it is not however, anything more than a rectangle wireframe) I get this error:

Error, bad translucent sortType

scenestate.cc line 268

which corresponds to:

void SceneState::insertRenderImage(SceneRenderImage* ri)
{
   if (ri->isTranslucent == false)
      mRenderImages.push_back(ri);
   else
   {
      if (ri->sortType == SceneRenderImage::Plane)
      {
         mTranslucentPlaneImages.push_back(ri);
      }
      else if (ri->sortType == SceneRenderImage::Point)
      {
         mTranslucentPointImages.push_back(ri);
      }
      else if (ri->sortType == SceneRenderImage::BeginSort)
      {
         mTranslucentBeginImages.push_back(ri);
      }
      else
      {
         AssertFatal(ri->sortType == SceneRenderImage::EndSort, "Error, bad transcluent sortType");
         mTranslucentEndImages.push_back(ri);
      }
   }
}

What exactly am I doing wrong? All I am trying to do is make a solid rectangle using only primitives that is semi-translucent. Something that I could do with glut in like 20seconds. I'm sure i'm just missing something :( Anyone care to divulge?

#1
08/21/2005 (10:08 pm)
Sure - set sortType to one of the sort types listed above!

I suggest Point.

Check other objects like StaticShape or TSStatic for examples of how to properly register a translucent render image.