Which formatters for glsl file

I open cesium source codes by vscode
when i change glsl file and want to format the glsl file
then it pop up the box below

I know you format js file by prettier.
but which formatters for glsl file you use?

@zxc1987

I would suggest using whatever you feel most comfortable with.

-Sam

i use “WebGL GLSL Editor” to format the glsl file.
glslFormat

but there have changes in git
when i format the glsl file even i don’t change any codes

i don’t want the format changes in git just because i format codes

@zxc1987

Try using Clang-Format instead. Let me know if this works better for you.

-Sam

@sam.rothstein
I tried Clang-Format extension
but it has some error in vscode
notwork
I’m not familiar with vscode
which extesion of vscode do you use to format glsl file?

@zxc1987

Maybe try this: https://github.com/evanw/glslx-vscode

Let me know if it works for you. I do not use vscode so it is a little bit difficult for me to give you guidance here. Any input from the rest of the community?

-Sam

@sam.rothstein
Unfortunately, it doesn’t work either
Thank you very much, too

1 Like

@zxc1987

I am sorry to hear that. As I said, I do not use vscode so I do not know of any great workarounds. Maybe check in on the vscode forum?

-Sam