OpenGL ES 2.0 displaying objects in opposite depth order using LibGDX -


I am using LibGDX and am designating some models. It expects that except "objects far away" objects are displayed "front" of "close" objects. In other words, for the order of depth I feel unlike what I intended for it.

Strangely, the model is cut in the right order by the clipping plane (the distance objects first have disappeared)

I have to enable GL_DEPTH_TEST Have tried, and I'm clearing GL_DEPTH_BUFFER_BIT .

Does anyone know what might be causing this?

If this is always right, check that you have passed something meaningful by default Usually the sensible is GL_LESS ; Try GL_GREATER .

If the order appears to be an order, then if you are issuing the Draw Call, check that you have a really deep buffer. It is difficult to be more specific without knowing the LibGDX backend you use, but unless the depth buffer is allocated, no matter what you do with the depth test, the buffer's There is no storage for.

Correct answer, according to the comment of the twitter below:

I need to set GL_LESS, but obviously when you use glDepthFunc () Apparently LibGDX does not like it My custom shader implements the Shadar class, so I had to use an alternate contact which was passed by the initial () method, then I added this line: context.setDepthTest (GL20.GL_LESS);

My guess is that LibGDX is doing something intelligent with threading and the proper reference is not set before calling the shader eits (or possibly, libdx strictly wants you to Use clear references instead of one underlying one and therefore exit in a way that is not set in a way - possibly in the future and where coding rules want to be kept uniform) just a random one Numan is, of course.


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -