-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Add methods to get and set shader attribute locations #999
base: master
Are you sure you want to change the base?
Conversation
This is a start, but I was already considering an API that allowed newer GLSL to be used with sfml-graphics rendering as well. Your code only benefits users who use |
Can you explain what you have in mind exactly? How could this new stuff be combined with sfml-graphics, and how would you modify the API to allow that? |
Just like how you can bind a GLSL sampler to |
Actually, I'd thought about something like this too, but wasn't sure how to go about it. The thing is, SFML currently uses standard vertex attributes through On a side note, I also found the following in the docs for 3.0+: "the location of the attribute specified in the shader's source [with |
Not necessarily. There are 3 cases:
|
Causes `getAttribLocation` to retrieve the *actual* attribute location, even if it has been overridden in shader source with `layout(location)`.
Updated PR; now allows for locations overridden in the shader.
Of course, sorry. I was only thinking about case 3. :) Unfortunately, though, I still don't really see a way to do it the way you're suggesting:
The standard attributes I'll keep looking at this, though, and I'm open to suggestions. |
@binary1248 will this be obsolete with the legacy shader changes you have in the pipeline? |
Possibly. |
@binary1248 I assume the situation has not changed since 2018? |
@Bromeon It hasn't. |
Implements #987 (forum post).
Fixed attribute locations may be assigned before loading the shader source, and/or the locations assigned by the shader compiler may be retrieved afterward.
Usage: