Chapter 17 - GenericMaterial Bombs
by David Everhart · in · 12/17/2008 (2:52 pm) · 1 replies
I am testing out the setup for the HLSL from the example:
It will bomb on the material.EffectFileName, because the texturebinds are null at that point. GenericMaterial.cs line 582. It will also bomb on the floatbinds check as well. Any idea on this? I can easily modify the source if I have to by adding a null check, but wanted to make sure there wasnt something wild going on.
GenericMaterialTextureBind textureBind = new GenericMaterialTextureBind();
textureBind.BindType = BindType.Name;
textureBind.BindAddress = "baseTexture";
textureBind.TextureFilename = "images/Background.png";
GenericMaterial material = new GenericMaterial();
material.EffectFilename = "data/TestEffect.xnb";
material.TextureBinds.Add(textureBind);It will bomb on the material.EffectFileName, because the texturebinds are null at that point. GenericMaterial.cs line 582. It will also bomb on the floatbinds check as well. Any idea on this? I can easily modify the source if I have to by adding a null check, but wanted to make sure there wasnt something wild going on.
Torque Owner David Everhart
GenericMaterial material = new GenericMaterial(); material.EffectFilename = "data/TestEffect.xnb"; material.TextureBinds = new List<GenericMaterialTextureBind>(); material.TextureBinds.Add(textureBind);