Grass Node "Black Rectangles"

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
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Grass Node "Black Rectangles"

Post by hbraun »

Hi there,

I´ve been trying to get the GrassNode working properly but I couldn't get it to work! :(

The grass is appearing all black.

I don't know if is the 1.4 Irrlicht version that I am using, I tried using other textures (thought it was an alfa or color key problem) but no success.

Can anyone help?
I believe its very simple problem, but I just cant see where is it!

Thanks,

Braun
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Have you got a light in your scene or lighting turned off on the grass node? Sounds like that's problem!
Image Image Image
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Post by hbraun »

Thanks for the quick reply JP,

Yeah, I got a light and the node is set lightning false, just like the example.
The scene has other objects, only the grass isn't appearing properly.

I thought it was something wrong in my code, so I compiled the "original" source code and the same thing happens there. :?

Thanks,

Braun
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The old code didn't use proper method signatures for Irrlicht 1.4/1.5. Thus, wrong overloads lead to all materials missing. Check the irrExt project, should have working code sometime soon.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Ahh yes... If you can't find working code then try and fix it yourself. Basically check all the functions of the grass node against those in ISceneNode and make sure they have the right parameters and qualifiers. Some functions became const in irrlicht since the grass node was originally written and some functions changed their parameters or return values, such as s32s being changed to u32s.
Image Image Image
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Post by hbraun »

Thanks again for the help

I´ll check that. :)

Braun
hbraun
Posts: 28
Joined: Tue Dec 16, 2008 7:33 pm
Location: Porto Alegre, Brazil
Contact:

Post by hbraun »

Ahh yes... If you can't find working code then try and fix it yourself. Basically check all the functions of the grass node against those in ISceneNode and make sure they have the right parameters and qualifiers. Some functions became const in irrlicht since the grass node was originally written and some functions changed their parameters or return values, such as s32s being changed to u32s.
That worked! It was really simple, but hard to see!

There was a "const" missing in the "getMaterialCount()" function, so it was always returning 0. :x

For 1.4 or 1.5 Irrlicht version here it is:

Code: Select all

//! Returns amount of materials used by this scene node.
virtual u32 getMaterialCount() const;
must fix in the cpp too.

Thanks a lot JP and hybrid, I was losing my mind!

Braun
Leomond
Posts: 2
Joined: Wed Dec 17, 2008 5:45 pm
Contact:

Nice!

Post by Leomond »

Really good shot hbraun!

I was having a headache too. Saved me a lot of time!
Post Reply