Ignoring Vertex Colour

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
aheymann
Posts: 153
Joined: Wed Aug 22, 2007 12:25 pm
Location: England

Ignoring Vertex Colour

Post by aheymann »

Hallo

I need to achieve a specific display within in my application. This is to show a model with hidden lines removed. I have achieved this result, no problem at all and it is done, by displaying a wireframe of the model, plus displaying all the faces in the model with the same colour. However, when a mesh buffer was created with a vertex colour, IT is used for the colour of the material, resulting in some of the faces in the model, displaying in the original colour, rather that the 'uniform' hidden line plane colour.

I hope this makes sense. I basically want to display the scene, but the engine should ignore the vertex colour. Of course I can go through all the nodes and set the vertex colour (using a mesh manipulator), but then I loose the original colour of the vertex, which I do require. I could copy the vertex buffer to a temp buffer, change the vertex colours and then copy it back, when the mode is switched off, but that does sound slow and uses a lot of extra memory.

Any clever ideas?

Anton
Klasker
Posts: 230
Joined: Thu May 20, 2004 8:53 am
Contact:

Post by Klasker »

It sounds like you need a shader, if you know how.
aheymann
Posts: 153
Joined: Wed Aug 22, 2007 12:25 pm
Location: England

Post by aheymann »

No, never done it - give me a clue!!!! :)
aheymann
Posts: 153
Joined: Wed Aug 22, 2007 12:25 pm
Location: England

Post by aheymann »

Looks like I am going to become intimately familiar with Example 10.Shaders:)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

How are you getting the faces of the model to display in the same colour as the lines?

I presume you're not using lighting in your scene? When irrlicht uses lighting on a model it ignores the vertex colours and instead just uses the texture.
Image Image Image
aheymann
Posts: 153
Joined: Wed Aug 22, 2007 12:25 pm
Location: England

Post by aheymann »

I want the colour of the planes and lines to be different, to create the hidden line effect. The planes will be drawn in gray (how exciting) and the lines in black. Lighting is OFF.

Anton
Post Reply