private void AddFloat(string name, GenericMaterial genericMaterial, long paramId, float defaultValue) { if (floatByParamId.ContainsKey(paramId)) { var value = floatByParamId[paramId]; genericMaterial.AddFloat(name, value); } else { genericMaterial.AddFloat(name, defaultValue); } }
private void AddFloat(GenericMaterial genericMaterial, long paramId, float defaultValue) { var name = $"param{paramId.ToString("X")}"; if (floatByParamId.ContainsKey(paramId)) { var value = floatByParamId[paramId]; genericMaterial.AddFloat(name, value); } else { genericMaterial.AddFloat(name, defaultValue); } }
private GenericMaterial CreateGenericMaterial() { // Don't use the default texture unit. var genericMaterial = new GenericMaterial(1); AddTextures(genericMaterial); // HACK: There isn't an easy way to access the current frame. genericMaterial.AddFloat("currentFrame", CurrentFrame); genericMaterial.AddFloat("depthBias", DepthBias); // TODO: Convert from quaternion values in light.nuanimb. AddQuaternion("chrLightDir", genericMaterial, -0.453154f, -0.365998f, -0.211309f, 0.784886f); return(genericMaterial); }
private GenericMaterial CreateGenericMaterial() { // Don't use the default texture unit. var genericMaterial = new GenericMaterial(1); AddTextures(genericMaterial); genericMaterial.AddFloat("depthBias", DepthBias); genericMaterial.AddVector3("materialId", MaterialIdColorRgb255 / 255f); // TODO: Convert from quaternion values in light.nuanimb. AddQuaternion("chrLightDir", genericMaterial, -0.453154f, -0.365998f, -0.211309f, 0.784886f); return(genericMaterial); }
public GenericMaterial CreateGenericMaterial(Material material) { // Don't use the default texture unit. var genericMaterial = new GenericMaterial(1); AddTextures(genericMaterial); genericMaterial.AddBoolToInt("useStippleBlend", UseStippleBlend); // HACK: There isn't an easy way to access the current frame. genericMaterial.AddFloat("currentFrame", CurrentFrame); genericMaterial.AddBoolToInt("hasCustomVector44", vec4ByParamId.ContainsKey(MatlEnums.ParamId.CustomVector44)); genericMaterial.AddBoolToInt("hasCustomVector47", vec4ByParamId.ContainsKey(MatlEnums.ParamId.CustomVector47)); // TODO: Convert from quaternion values in light.nuanimb. AddQuaternion("chrLightDir", genericMaterial, -0.453154f, -0.365998f, -0.211309f, 0.784886f); return(genericMaterial); }