UltravioletFramework / ultraviolet

The Ultraviolet Framework is a .NET game development framework written in C#.
https://github.com/UltravioletFramework/ultraviolet/wiki
MIT License
542 stars 46 forks source link

MatrixArray not supported #90

Closed stefnotch closed 6 years ago

stefnotch commented 6 years ago

I tried writing a GPU skinning shader and wanted to pass an array of matrices to the shader.

However, the following error popped up when attempted to apply the current effect pass (someEffectPass.Apply())

System.NotSupportedException: 'Unsupported data type.'

After digging a bit into the source code, the cause of the error seems to be around here:

https://github.com/tlgkccampbell/ultraviolet/blob/823861bec534a6e7458436e06ec15baed0803668/Source/Ultraviolet.OpenGL/Shared/Graphics/OpenGLShaderUniform.cs#L135

It's missing the following lines of code:

case OpenGLEffectParameterDataType.MatrixArray:
    SetValue(source.GetMatrixArray());
    break;