GL_Line Extension not drawing
Page 1 of 1

Author:  SpOOky [ 07.04.2012, 09:32 ]
Post subject:  GL_Line Extension not drawing

I'm trying to build an extension that will render the manipulators for an editor. I've based the extension on the terrain one and started with the grid drawn with GL_Line(s).

The node registers and it is outputted in the log, but it doesn't draw anything. I have the following drawing code:

   void GridNode::renderFunc(uint32 firstItem, uint32 lastItem, const std::string &shaderContext,
      const std::string &theClass, bool debugView, const Frustum *frust1, const Frustum *frust2,
      RenderingOrder::List order, int occSet )
      CameraNode *curCam = Modules::renderer().getCurCamera();
      if( curCam == 0x0 ) return;

      const RenderQueue &renderQueue = Modules::sceneMan().getRenderQueue();

      for( uint32 i = firstItem; i <= lastItem; ++i )
         GridNode *grid = (GridNode *)renderQueue[i].node;

         drawGrid(grid, curCam, frust1, frust2);

   void GridNode::drawGrid(GridNode *grid, CameraNode *cam, const Frustum *frust1, const Frustum *frust2)
      // TODO fustrum culling check



      const float* camTrans = 0;
      cam->getTransMatrices(0, &camTrans);
      Matrix4f transMat (camTrans);

      const float* gridTrans = 0;
      grid->getTransMatrices(0, &gridTrans);
      Matrix4f gridTransMat (gridTrans);

      glColor4f(grid->_col_R, grid->_col_G, grid->_col_B, grid->_colMult);
      glVertex3f( 0.0f, 0.0f, 0.0f);
      glVertex3f(100.0f, 100.0f, 100.0f);


Author:  Volker [ 07.04.2012, 10:27 ]
Post subject:  Re: GL_Line Extension not drawing

Did you check if the renderFunc has been called? Your may also have to make sure that the rendering code will be done within the correct framebuffer, which may depend on the currently loaded pipeline config. You may also think about using fixed function pipeline mode in an engine based purely on shaders. I used the fixed function pipeline in the Horde3D Editor myself, but wouldn't do it if I had to reimplement it today. And if you want to integrate your code as an extension I really would think about using fixed function code.

Author:  SpOOky [ 07.04.2012, 13:14 ]
Post subject:  Re: GL_Line Extension not drawing

I've placed a breakpoint in GridNode::drawGrid and the programs stops executing, so I know GridNode::renderFunc is called.

Regarding the context, I don't think I placed it in any. How would I do that?

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group