Use unsigned integers for material effects

This generated a run-time error on NVIDIA.
Correction how "flat" keyword is used

This generated an error on NVIDIA.