Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoadShader illegal non-ASCII character #30

Open
eliasstepanikVW opened this issue Dec 6, 2022 · 2 comments
Open

LoadShader illegal non-ASCII character #30

eliasstepanikVW opened this issue Dec 6, 2022 · 2 comments

Comments

@eliasstepanikVW
Copy link

eliasstepanikVW commented Dec 6, 2022

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.

@eliasstepanikVW
Copy link
Author

eliasstepanikVW commented Dec 6, 2022

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);

@jasonswearingen
Copy link
Member

okay will leave open so if someone notices the same issue, they can mention (and if your workaround fixes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants