Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: gl_TexCoord undeclared  (Read 3369 times)

0 Members and 1 Guest are viewing this topic.

abreu20011

  • Newbie
  • *
  • Posts: 2
    • View Profile
gl_TexCoord undeclared
« on: June 23, 2019, 07:27:25 pm »
Hi everyone  :)

I have a fragment program that works fine into my main machine, but into a laptop with updated graphics drivers (Intel HD Grapchics) throws an error. Anyone imagine what's happens?

Seems to be a internal problem into SFML to initialize this variable correctly.
Besides, into my main machine if I don't declare version shader, no error are generated, but in this laptop I need to declare versiĆ³n to stop complaining GLSL errors.

I tried all GLSL versions, from 110 to 420 and in all versions don't works.
Actually my current versions are declared like this: #version 150 core

This line...:

vec2 uv = gl_TexCoord[0] + make_uv_from_rotation();

Throws the next error:

Failed to compile fragment shader:
ERROR: 0:39: 'gl_TexCoord' : undeclared identifier
ERROR: 0:39: 'gl_TexCoord' : left of '[' is not of type array, matrix, or vector
 

Hapax

  • Hero Member
  • *****
  • Posts: 3379
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: gl_TexCoord undeclared
« Reply #1 on: June 23, 2019, 10:42:02 pm »
Are you using a custom vertex shader? Are you preparing it there?
See the minimal vertex shader:
https://www.sfml-dev.org/tutorials/2.5/graphics-shader.php#minimal-shaders

Also, should you not also be specifying the components that are required?
e.g. gl_TexCoord[0].st
(or at least the components of the final result of your addition)
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

abreu20011

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: gl_TexCoord undeclared
« Reply #2 on: October 19, 2020, 03:56:11 am »
Just in case someone find this usefull, I don't remember the exactly problem of this, but one problem you can find is the the texture rect.

m_Shape->setTextureRect(IntRect(0, 0, 1, 1));
 

if you don't set any texture, SFML doesn't call setTextureRect, so has a value of {0,0,0,0}