Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

Vertex attributes might not be bound correctly #77

Open
JayFoxRox opened this issue Nov 2, 2018 · 1 comment
Open

Vertex attributes might not be bound correctly #77

JayFoxRox opened this issue Nov 2, 2018 · 1 comment

Comments

@JayFoxRox
Copy link
Owner

JayFoxRox commented Nov 2, 2018

Migrated from original GitLab issue 72

nvidia had this thing where each fixed-function attribute mapped to an index in the hardware.
However, as generic binding of vertex attributes by index was started, this overlapped.

See https://www.khronos.org/registry/OpenGL/extensions/NV/NV_vertex_program.txt (2.14.1.6 Semantic Meaning for Vertex Attributes and Program Parameters)

glVertexAttribPointerARB(3, ..) should actally be an alias for glColorPointer

I'm not sure how GLSL handles this, it seems to work fine for attribute 0 as gl_Position, but that might just be luck?

Unfortunately, doing this the other way around (mapping old-attributes to custom ones) would require emulation of the fixed function pipeline or duplicate uploads (to custom attributes and the fixed-function ones).

So to resolve this, glVertexAttribPointerARB should always alias, except for weights (probably).

A better solution can be implemented later.

@JayFoxRox
Copy link
Owner Author

I've done this and it seems to help, but it's still not looking correct.

I came up with another hack now, but this might upload attributes twice (although this could be improved).

!!! The hack does not work for immediate mode though !!!

(Probably doesn't work without vertexshader either?!)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant