Culling is off

Culling is off
63 Replies
Kai
Kai11mo ago
Ok so looking at this
Kai
Kai11mo ago
I presume this is correct
Wulferis
Wulferis11mo ago
Yeah thats the correct data being fed into the Position buffer
Wulferis
Wulferis11mo ago
No description
Kai
Kai11mo ago
was this supposed to be indexed? You provide 6 to glDrawElements, but the index buffer seems empty?
Wulferis
Wulferis11mo ago
No description
Wulferis
Wulferis11mo ago
In the Index buffer set RenderDoc byte offset to 0?
Kai
Kai11mo ago
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
Wulferis
Wulferis11mo ago
Yeah it does that to me too We think its a RenderDoc bug
Kai
Kai11mo ago
Hmm, seems fishy but maybe?
Wulferis
Wulferis11mo ago
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
Wulferis
Wulferis11mo ago
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
No description
Wulferis
Wulferis11mo ago
No description
Kai
Kai11mo ago
My OpenGL is very rusty so bare with me
Wulferis
Wulferis11mo ago
All g Any help is better then nothing at this point Been stuck on this for a week now
Kai
Kai11mo ago
Ok might be me not understanding OpenGL especially not from the renderdoc trace, but why are there so many vertex attributes?
Kai
Kai11mo ago
this looks normal to me from the offsets I'm guessing you're packing a bunch of info into one big buffer?
Wulferis
Wulferis11mo ago
Yeah my previous VAO had all attributes in differant buffers this one packs them all into 1
Kai
Kai11mo ago
I see
Wulferis
Wulferis11mo ago
both had the same issue
Kai
Kai11mo ago
so is this UVs? or what is this
Wulferis
Wulferis11mo ago
Yeah UVs
Kai
Kai11mo ago
ah found the shader, ok just for reference
Kai
Kai11mo ago
ok so attribute 1-4 are unused but you bind them - that's why it didn't show up in renderdoc at first
Wulferis
Wulferis11mo ago
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
Kai
Kai11mo ago
? this confuses me - I though the whole problem was that VS only gets the first vertex?
Wulferis
Wulferis11mo ago
It only gets the Data of the first one the rest appear as empty '--' actually it sees 5 vertices it should be 4
Wulferis
Wulferis11mo ago
No description
Wulferis
Wulferis11mo ago
idk if this means anything
Kai
Kai11mo ago
sees
not sure what that's supposed to mean? Like you logged the count in the shader?
Wulferis
Wulferis11mo ago
the Mesh in RenderDoc has 0,1,2,3,4,5 vertices but only 0 has a position idk what that means
Kai
Kai11mo ago
I see what you mean Thought there was some logging or something you tried
Wulferis
Wulferis11mo ago
If i try a larger a mesh
No description
Wulferis
Wulferis11mo ago
its a larger list, this ones a correct count, 0-35 with 36 total vertices
Wulferis
Wulferis11mo ago
No description
Kai
Kai11mo ago
Yeah I think that count is just taken form drawElements
Wulferis
Wulferis11mo ago
taht would make sense actually
Kai
Kai11mo ago
Maybe I'm crazy
Wulferis
Wulferis11mo ago
the Quad is 6 triangles so 0-5
Kai
Kai11mo ago
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?
Wulferis
Wulferis11mo ago
Color is 4 floats so 1 extra float
Kai
Kai11mo ago
ah ? says 3 here
Wulferis
Wulferis11mo ago
Oh typo
Kai
Kai11mo ago
It's right here I doubt it but maybe that's (a) problem?
Wulferis
Wulferis11mo ago
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
Kai
Kai11mo ago
I think this is right?
Wulferis
Wulferis11mo ago
looks right
Kai
Kai11mo ago
hmm is there supposed to be stride on index buffers? I just really don't know
Wulferis
Wulferis11mo ago
I imagine so?
Kai
Kai11mo ago
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?
Wulferis
Wulferis11mo ago
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
Kai
Kai11mo ago
hmm ok was worth a shot 1s I'll be back
Wulferis
Wulferis11mo ago
DrawArrays with an empty VertexArray, so just pushing vertices and setting them up in a Vertex Shader works fine
Kai
Kai11mo ago
Hmm, tried to reproduce this a few hours ago, but didn't get anywhere... My OpenGL is unfortunately lacking