Shadow 'resolution' & colorised billboards

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.
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Use the GetMaterial function on the billboard node, then set ambient, specular and/or emmisive colours to change the colour.

SMaterial material = pBill->getMaterial( 0 );
SColor AmColour = material.AmbientColor();

Ok, that gets me the material being used by the node, but how do I set it? As in I can get the material and it's ambeint colour, but how do I set it?
Redemption
Posts: 13
Joined: Sat Nov 11, 2006 1:31 pm

Post by Redemption »

Saturn wrote:Again: What shadow technique are you using, when you say that this is not stencil shadow?
Just the default shading that you get when you add lights to the scene and have lighting on the node set to true.
hybrid wrote:It's definitely a problem of the normals. 3ds meshes do not support smoothing groups, thus normals are not smoothed at face edges.
Hmm, I am using .x meshes exported with the panda exporter though. The shading looks fine in MS's DirectX Viewer. I'll try finding some other program that exports x meshes and make a quick sphere with that, see if I get similair results.
goaty wrote:
Use the GetMaterial function on the billboard node, then set ambient, specular and/or emmisive colours to change the colour.

SMaterial material = pBill->getMaterial( 0 );
SColor AmColour = material.AmbientColor();

Ok, that gets me the material being used by the node, but how do I set it? As in I can get the material and it's ambeint colour, but how do I set it?
Not a c++ programmer myself, but I reckon it would be something like:

Code: Select all

SMaterial material = pBill->getMaterial( 0 );
material.AmbientColor() = new Color(255, 255, 0, 0);
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Thanks, but didnt work. Does anyone, the original poster would be nice, know how to colourise a textured billboard?
Redemption
Posts: 13
Joined: Sat Nov 11, 2006 1:31 pm

Post by Redemption »

goaty wrote:Thanks, but didnt work. Does anyone, the original poster would be nice, know how to colourise a textured billboard?
Well, I got it to work with the .net version in a quick testproject with a lit billboard, and by setting either the emmisive, specular or ambient color or a combination of those (can't remember exactly, was a while back). I do remember it only worked when it was lit though, unless I did something wrong. :)
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Ok Thanks, but it doesn't work in VC++7.0. The new operator will return a pointer and the AmbientColor is a SColor class, not a pointer. My billboard has got a texture, on layer 1(0), and material type of transparent with alpha and lighting enabled. I'll be fooled if I can get it to colourise the textured billboard on render, no matter how much I play with the material properties.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post by vitek »

Just remove the new and make it a color assignment.
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

Strange. I can get the billboard colourisation to work when I use the OPENGL driver, but not with the D3D8/9 drivers. Anyone, know of any reasons for that?
goaty
Posts: 46
Joined: Wed Oct 25, 2006 3:06 pm

Post by goaty »

OK. I'll shut up about this as no one can obviously answer it. I think I'll start delveing into the source library code. Thanks to those for the help! :D Much appriciated.
Post Reply