63 Replies
Ok so looking at this
I presume this is correct
Yeah
thats the correct data being fed into the Position buffer
was this supposed to be indexed? You provide 6 to glDrawElements, but the index buffer seems empty?
In the Index buffer set RenderDoc byte offset to 0?
yes
Stride 4, which should be right for uint, offset 0, divisior 0, 24 bytes (=6 ints)
oh no wait? Maybe the start is 24
maybe renderdoc is playing me, but it started with 24 there at the top
Yeah it does that to me too
We think its a RenderDoc bug
Hmm, seems fishy but maybe?
yeah i havent had it happen before so it is a lil weird for it to happen how at the same time this weird bug is occuring
When i rewrote the VBO's and stuff i just ripped the stuff from Silk.nets Examples and made some small API Adfustments
But even before the adjustments it had the same issue
My OpenGL is very rusty so bare with me
All g
Any help is better then nothing at this point
Been stuck on this for a week now
Ok might be me not understanding OpenGL especially not from the renderdoc trace, but why are there so many vertex attributes?
this looks normal to me
from the offsets I'm guessing you're packing a bunch of info into one big buffer?
Yeah
my previous VAO had all attributes in differant buffers
this one packs them all into 1
I see
both had the same issue
so is this UVs? or what is this
Yeah UVs
ah found the shader, ok just for reference
ok so attribute 1-4 are unused but you bind them - that's why it didn't show up in renderdoc at first
yeah atm the shader is just trying to draw a White quad to the screen
but vertexPosition only ever gets the first entry inside it
the VertexShader sees the Count of vertices
and fills them all with -- values in renderdoc
only the first actually has content
? this confuses me - I though the whole problem was that VS only gets the first vertex?
It only gets the Data of the first one
the rest appear as empty '--'
actually it sees 5 vertices
it should be 4
idk if this means anything
seesnot sure what that's supposed to mean? Like you logged the count in the shader?
the Mesh in RenderDoc has 0,1,2,3,4,5 vertices
but only 0 has a position
idk what that means
I see what you mean
Thought there was some logging or something you tried
If i try a larger a mesh
its a larger list, this ones a correct count, 0-35 with 36 total vertices
Yeah I think that count is just taken form drawElements
taht would make sense actually
Maybe I'm crazy
the Quad is 6 triangles so 0-5
Is there really 60 bytes in that struct?
3 * 4 + 2 * 4 + 3* 4 + 3* 4 + 3*4 = 56 no?
are there 4 extra padding bytes?
Color is 4 floats
so 1 extra float
ah
?
says 3 here
Oh
typo
It's right here
I doubt it but maybe that's (a) problem?
Yeah didnt fix it
I've been testing a lot and changing a lot since this bug appeared
I think during my rewrite of the VAO/VBO i may have changed color to 4 floats
I think this is right?
looks right
hmm
is there supposed to be stride on index buffers? I just really don't know
I imagine so?
It seems like OpenGL already accounts for type size? So maybe it's supposed to be stride = 0?
cause you already give uint as the index type, so it already does 4 bytes at a time?
and with stride = 4 skips over the next 4, overflowing the buffer?
I dont think i assign a stride for the index buffer?
i assign a Size and the data
its just GenBuffer(); and Graphics.GL.BufferData(type, count, data, usage);
with a Bind in the middle
hmm ok
was worth a shot
1s I'll be back
DrawArrays with an empty VertexArray, so just pushing vertices and setting them up in a Vertex Shader works fine
Hmm, tried to reproduce this a few hours ago, but didn't get anywhere... My OpenGL is unfortunately lacking