Jump to content

Error: Failed to compile fragment shader.


timetrx
 Share

Recommended Posts

Hello, I am a Kickstarter backer and I just installed the Leadwerks 3.1 Indie Edition from steam. When I first installed the Editor I got this message in the info/output box:

 

Initializing OpenGL4 graphics driver...

OpenGL version 420

GLSL version 420

Device: Intel® HD Graphics 4600

Loading texture "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Materials/Common/bfn.tex..."

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Editor/terraintool.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Editor/Wireframe.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Editor/solid.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Model/default.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Editor/grid.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Lighting/ambientlight.shader"...

Loading font "C:/Windows/Fonts/Arial.ttf" (10, 1, 1)...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Drawing/drawtext.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Drawing/drawprimitive.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Editor/skybox.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Misc/occlusionquery.shader"...

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Lighting/directionallight.shader"...

Loading material "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Materials/Icons/DirectionalLight.mat..."

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/shaders/editor/sprite.shader"...

WARNING: -1:65535: '#version' : version number deprecated in OGL 3.0 forward compatible context driver

ERROR: 0:28: 'texture2D' : function is removed in Forward Compatibile context

ERROR: 0:28: 'texture2D' : function is removed in Forward Compatibile context

ERROR: 0:28: '=' : cannot convert from 'const float' to '4-component vector of float'

Failed to compile fragment shader.

Error: Failed to compile fragment shader.

Loading texture "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Materials/Icons/directionallight.tex..."

Loading shader "C:/Users/Mike/Documents/Leadwerks/Projects/MyGame/Shaders/Lighting/directionallight.shader"...

 

 

I checked my Graphics Card Drivers, and they are the latest, so I have no clue why its doing this and I checked the forums and couldn't find this error reported anywhere. If this isn't a bug please move it to the proper section and sorry for the mistake.

Link to comment
Share on other sites

Hi,

 

Looking at the post, look like there something the shader compiler doesn't like in line 28 of the "sprite.shader". Intel syntax is really strict.

 

From the terms used to assign names to the shaders, the application will work correctly but you could see some rendering issues if you use sprites. (This is perhaps not true, that's only what I understand and deduce from the output there.)

 

How are theses shaders are used by the editor in the engine? I see lots of them. This is really interesting! Still trying to understand how a deferred renderer works...

Link to comment
Share on other sites

It's used in the point entity icon rendering.

 

If you replace all calls to "texture2D" with "texture" that will get rid of a lot of the errors. I don't know how this got through, because I tested on Intel chips.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Yea, replacing Texture2D with texture got rid of the errors. Thank you. But I'm still having issues is there a demo or a TDD, I can just load into the editor to figure it out and give feedback?

 

Btw, when the C++ scripting is added will we have a choice on which compiler (not the editor) to use (g++, clang++, VStudio, etc.) I only ask because the condition Visual Studio compiler is terrible and makes me want to laugh and then cry every time I see it used.

Link to comment
Share on other sites

Thank you. I will update the shader today in the beta branch.

 

We use the Microsoft compiler on Windows, GCC on Linux, and LLVM on Mac.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...