Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        private static void AddQuaternion(string name, GenericMaterial genericMaterial, float x, float y, float z, float w)
        {
            var lightDirection = GetLightDirectionFromQuaternion(x, y, z, w);

            genericMaterial.AddVector3(name, lightDirection);
        }