How to setMaterial to simplerenderable

Problems building or running the engine, queries about how to use features etc.
Post Reply
xuzhongxing
Gnoblar
Posts: 4
Joined: Wed Nov 28, 2018 1:57 pm
x 1

How to setMaterial to simplerenderable

Post 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?
paroj
OGRE Team Member
OGRE Team Member
Posts: 1994
Joined: Sun Mar 30, 2014 2:51 pm
x 1074
Contact:

Re: How to setMaterial to simplerenderable

Post by paroj »

do you have a light source? you can try adding "emissive" which works w/o lights.
xuzhongxing
Gnoblar
Posts: 4
Joined: Wed Nov 28, 2018 1:57 pm
x 1

Re: How to setMaterial to simplerenderable

Post by xuzhongxing »

Thank you. That must be the cause. I'll try it.
Post Reply