Jump to content

GLSL error highlighting HELP ME!

Kamjam66xx

Does anyone know anysort of text editor, ide, etc with good GLSL support, specifically syntax error highlighting?

 

I will literally have to spend an hour or more trying to figure out why i cant successfully compile my shaders, just to find some stupid little typo. 

 

I found simple GLSL support, but no error highlighting period of any sort, or intellisense. Its driving me nuts.

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Franck said:

 

Ya i was absolutely shocked at the lack of GLSL support when i started learning it. Cant wait to try it, thanks! 

Link to comment
Share on other sites

Link to post
Share on other sites

16 minutes ago, Kamjam66xx said:

Ya i was absolutely shocked at the lack of GLSL support when i started learning it. Cant wait to try it, thanks! 

Give a try to OpenTK. GLSL is so far the same code structure.

There is very very small difference but i haven't noticed it until i read about them and found out i intuitively used the correct method. Not a real example but it's like if Shader was called Shaders with an "s".

 

Anyway OpenTK does GLSL plus different versions at the same time too. They made different namespace to split them. I do believe i could do a mass replace and just change the namespace and boom it would work. Plus i love the touch of making another lib with a simple winform control, it's useful for very quick tests.

Link to comment
Share on other sites

Link to post
Share on other sites

7 hours ago, Franck said:

Give a try to OpenTK. GLSL is so far the same code structure.

I'll have to add it to the list. Top priority for me next is vulkan and c# and developing in unity for a company. i expect it to go quick though. 

Link to comment
Share on other sites

Link to post
Share on other sites

13 hours ago, Kamjam66xx said:

I'll have to add it to the list. Top priority for me next is vulkan and c# and developing in unity for a company. i expect it to go quick though. 

Vulkan is thought to get it to work on C#. Very buggy and not complete. Unless there is another implementation than VulkanSharp. So don't have too much expectation from it. If you are interested in it I highly suggest you to go directly on Chronos website and work with the original C or C++ implementation.

Link to comment
Share on other sites

Link to post
Share on other sites

If you're using visual studio and cmake, it's possible to pre-validate your shaders with glslangValidator as part of the build (that's what I do). It reports shader compile errors within the IDE (not in realtime though, only when you build) before the application has the chance to run and show you a black screen ?

 

In a pinch, you could try using http://shader-playground.timjones.io (just make sure to pick GLSL as the source language). 

It has the added advantage of showing you the generated SPIR-V or DXIL (in case you want to explore that), and ability to chain different tools together (like putting generated SPIR-V through SPIRV-Cross).

Link to comment
Share on other sites

Link to post
Share on other sites

On 1/28/2019 at 12:50 AM, nicebyte said:

If you're using visual studio and cmake, it's possible to pre-validate your shaders with glslangValidator as part of the build (that's what I do). It reports shader compile errors within the IDE (not in realtime though, only when you build) before the application has the chance to run and show you a black screen ?

 

In a pinch, you could try using http://shader-playground.timjones.io (just make sure to pick GLSL as the source language). 

It has the added advantage of showing you the generated SPIR-V or DXIL (in case you want to explore that), and ability to chain different tools together (like putting generated SPIR-V through SPIRV-Cross).

Thats awesome. OpenGL in c++ and glsl is fun, but when it doesnt work its a nightmare lol.

Link to comment
Share on other sites

Link to post
Share on other sites

If you do decide to go the CMake route, look into the `add_custom_command` directive. You can get glslangValidator binaries from the Khronos website (https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/) or just compile it from source (https://github.com/KhronosGroup/glslang).

 

I could post a snippet from my own cmake file here however, it won't work for you because my setup is most likely different from yours. If you try it and get stuck, just post here, maybe i'll be able to help.

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, nicebyte said:

 

Wow thanks. I didnt know that. Im not using opengles though. Is it a lot simpler?

 

Because im about 2,500 loc into my project to learn openGL and i just have objects with specular and color including textures, directional spot and point lights and shadows, and basic controls.

 

And really none of it is extra.

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, Kamjam66xx said:

Wow thanks. I didnt know that. Im not using opengles though. Is it a lot simpler?

 

Because im about 2,500 loc into my project to learn openGL and i just have objects with specular and color including textures, directional spot and point lights and shadows, and basic controls.

 

And really none of it is extra.

OpenGL ES is just a version of OpenGL for mobile devices. I would not say that it is simpler. Later versions of OpenGL ES (3.1+) supported by more powerful devices like adreno 630 are getting close in terms of capabilities to the desktop counterpart (i.e. 3.2 has compute shaders). Earlier versions (GL ES 2.0) have a  smaller API surface, however they have limited capabilities, making it harder to do certain things (and effectively sometimes forcing you to have two different paths if you want to support older hardware). GL ES 2 market share has been shrinking though. 

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, nicebyte said:

 

Oh okay, so more or less the same im assuming. I really didnt take any time to learn about openGL's neighbors and just dug right in. It gave me a new found love of mathematics.

 

I appreciate the links and info, because im ill equiped without proper error reporting. Ill try to make it work, and see what happens.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×