Page 2 of 2

Posted: Mon Nov 27, 2006 11:19 am
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?

Posted: Mon Nov 27, 2006 5:33 pm
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);

Posted: Tue Nov 28, 2006 10:43 am
by goaty
Thanks, but didnt work. Does anyone, the original poster would be nice, know how to colourise a textured billboard?

Posted: Tue Nov 28, 2006 9:52 pm
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. :)

Posted: Wed Nov 29, 2006 1:00 pm
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.

Posted: Wed Nov 29, 2006 1:18 pm
by vitek
Just remove the new and make it a color assignment.

Posted: Wed Nov 29, 2006 2:00 pm
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?

Posted: Thu Nov 30, 2006 11:01 am
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.