problem with individual materials

Sep 7, 2010 at 11:00 AM

Hi, i'm trying to do runtime replacement of materials on individual faces.

reason is just to change the coloring of certain faces.

i use code like this:

foreach (SVSSurfaceElement surface in theArrowNode.ArrowContentSurfaces)
                        if (surface.SurfaceType == "Arrow")
                            FullDetailLevel.GetFace(surface.Index).Material = new Balder.Materials.Material { Ambient = Colors.Green, Diffuse = Colors.Green, Specular = Colors.Green, Shade = Balder.Materials.MaterialShade.Gouraud, DoubleSided = true , Solid = true};


but it seems like the color somehow is rendered inside the arrow objects ! i know the faces are drawn correct, in a counter clockwise manner.

also i'm using the source tagged Balder_0a9a0922adf6

can this be an bug in this version, that are already corrected or do i need to call anything extra to make i work ?

thank in advance

Sep 7, 2010 at 12:07 PM

The source you're using is more than a month old, so it might have been fixed. Theres been a lot done since then. 

Could you update the source and see if the problems goes away, if not - please report back and I can see whats going on.

Sep 10, 2010 at 2:01 PM

I have tryed the latest source da7dc7bccc74, but it doesn't seem to help.

but the Geometry.Color property is rendered  now  when set from inside child constructor :-)

currently i invoke the game / object by doing :

                _geometryObject = _builderInstance.Create(Colors.Blue,true, true, true,this);
	       // adding other elements here ..         
theGame.Camera = _camera;
Balder still rocks alot :-)
Sep 13, 2010 at 6:58 AM


I'll need to look into this, there is probably a bug that makes it apply the color instead of using the Material you're setting.

Sep 13, 2010 at 6:59 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 13, 2010 at 6:59 AM

sorry for this last post seems like i misused the material.Diffuse property on the material.

now the color gets rendered just right.

Sep 13, 2010 at 7:02 AM

Ok. Great. I'll close the work item I created. :)