LoadShader illegal non-ASCII character
Hallo, i wanted to load a Shader.
So I first tried using LoadShader..
LoadShader(Textformat(string, value),Textformat(string,value))
It then showes: [11:41:07 INF] FILEIO: [Data/Scenes/Test2/Shader/base_lighting.vert] Text file loaded successfully [11:41:07 INF] FILEIO: [Data/Scenes/Test2/Shader/lighting.frag] Text file loaded successfully
but then it print out this: ` [11:41:07 WRN] SHADER: [ID 4] Failed to compile vertex shader code [11:41:07 WRN] SHADER: [ID 4] Compile error: ERROR: 0:1: '' : illegal non-ASCII character (0xef) ERROR: 0:1: '' : illegal non-ASCII character (0xbb) ERROR: 0:1: '' : illegal non-ASCII character (0xbf)
[11:41:07 WRN] SHADER: [ID 5] Failed to compile fragment shader code [11:41:07 WRN] SHADER: [ID 5] Compile error: ERROR: 0:1: '' : illegal non-ASCII character (0xef) ERROR: 0:1: '' : illegal non-ASCII character (0xbb) ERROR: 0:1: '' : illegal non-ASCII character (0xbf)
[11:41:07 WRN] SHADER: [ID 6] Failed to link shader program [11:41:07 WRN] SHADER: [ID 6] Link error: Attached vertex shader is not compiled. `
My shader Files are from the basic_lighting Example.
Fixed the issue by using LoadShaderFromMemory
var vertPath = string.Format("Data/Scenes/{0}/Shader/{1}",scriptDto.LoadedScenes[0].Name, ShaderFile.VertexShaderFile); var fragPath = string.Format("Data/Scenes/{0}/Shader/{1}",scriptDto.LoadedScenes[0].Name, ShaderFile.FragmentShaderFile);
//_shader = LoadShader(vertPath,fragPath);
var vertFileData = File.ReadAllText(vertPath);
var fragFileData = File.ReadAllText(fragPath);
_shader = LoadShaderFromMemory(vertFileData, fragFileData);
okay will leave open so if someone notices the same issue, they can mention (and if your workaround fixes)