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

How to setMaterial to simplerenderable

Post by xuzhongxing » Wed Nov 28, 2018 2:04 pm

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?
0 x

paroj
OGRE Team Member
OGRE Team Member
Posts: 909
Joined: Sun Mar 30, 2014 2:51 pm
x 197
Contact:

Re: How to setMaterial to simplerenderable

Post by paroj » Wed Nov 28, 2018 2:52 pm

do you have a light source? you can try adding "emissive" which works w/o lights.
0 x

xuzhongxing
Gnoblar
Posts: 4
Joined: Wed Nov 28, 2018 1:57 pm

Re: How to setMaterial to simplerenderable

Post by xuzhongxing » Thu Nov 29, 2018 2:42 am

Thank you. That must be the cause. I'll try it.
0 x

Post Reply