Page 1 of 1

How to setMaterial to simplerenderable

Posted: Wed Nov 28, 2018 2:04 pm
by xuzhongxing
Ogre Version: 1.11
Operating System: Ubuntu
Render System: GLRenderSystem


I created a SimpleRenderable, which contains 2 points for a line, whose render op type is OT_LINE_LIST.
And I setMaterial to it to the following simple material:

Code: Select all

material Green
{
  technique
  {
    pass ambient
    {
      ambient 0 1 0
      diffuse 0 1 0
      specular 0.1 0.1 0.1 1 1
    }
  }
}
And I created vertex buffer and color buffer for it in fillHardwareBuffers().
But the rendered line's color is black.

What steps do I need to do in order to let the material be used by the rendering?

Re: How to setMaterial to simplerenderable

Posted: Wed Nov 28, 2018 2:52 pm
by paroj
do you have a light source? you can try adding "emissive" which works w/o lights.

Re: How to setMaterial to simplerenderable

Posted: Thu Nov 29, 2018 2:42 am
by xuzhongxing
Thank you. That must be the cause. I'll try it.