Example #1
0
    private static ShaderValues[] InitializeMaterialProps(Type type)
    {
        var fields = type.GetFields();

        ShaderValues[] values = new ShaderValues[fields.Length];
        for (int i = 0; i < fields.Length; i++)
        {
            values[i].value = Shader.PropertyToID(fields[i].Name);
            var fieldType = fields[i].FieldType.ToString();
            values[i].type = fields[i].FieldType == typeof(float) ? "Float" : "Color";
        }
        return(values);
    }
		private void CreateShaderValuesWithBufferMustAlwaysBe16BytesAligned()
		{
			shaderBuffer = new SharpDXBuffer(nativeDevice, 2240, BindFlags.ConstantBuffer);
			shaderValues = new ShaderValues();
		}
 private void CreateShaderValuesWithBufferMustAlwaysBe16BytesAligned()
 {
     shaderBuffer = new SharpDXBuffer(nativeDevice, 2240, BindFlags.ConstantBuffer);
     shaderValues = new ShaderValues();
 }