mojira.dev

Daniel Mills

Assigned

No issues.

Reported

View all
MC-11099 Block Selector Overlays Block Particles Duplicate

Comments

I created a framebuffer for layered rendering in c++ to explain what I mean. like this

GLuint buffer;
glGenFramebuffers(1,&buffer);
glBindFramebuffer(GL_FRAMEBUFFER,buffer);

glFramebufferTexture(GL_FRAMEBUFFER,GL_COLOR_ATTACHMENT0,textures[0],0);

GLenum blub[] = {GL_COLOR_ATTACHMENT0};

glDrawBuffers(1,blub);

where textures[0] is a 3D texture for layered rendering. This layers the textures onto the attatchment (frame buffer)

When you aren't using pixel accelerated graphics (not using open gl, just from scratch) you usually run into issues with clipping. Its mainly objects behind other objects popping through.

Then I create and fill a buffer with vertex data for the points like this:

vector<vec2> points;
points.push_back(vec2(0.0f,0.0f)); //should draw in the middle
points.push_back(vec2(0.5f,0.5f)); //3/4th in each direction
points.push_back(vec2(-0.5f,-0.5f)); //opposite of second point
points.push_back(vec2(-0.95f,-0.95f)); //first texel on the bottom left

glGenBuffers(1,&result);

glBindBuffer(GL_ARRAY_BUFFER,result);
glBufferData(GL_ARRAY_BUFFER,points.size()*2*sizeof(float),&points[0],GL_STATIC_DRAW);
where vec2 is the vec2 floating point vector class provided by GLM.

Then I render it by doing this:

glViewport(0,0,textureSizeX,textureSizeY);
glBindFramebuffer(buffer);
glUseProgram(shader);
glBindBuffer(GL_ARRAY_BUFFER,_pointbuffer);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0,2,GL_FLOAT,GL_FALSE,0,0);
glDrawArrays(GL_POINTS,0,4);
where shader is a shader constructed from vertex, geometry and fragment shaders. It compiles fine without warnings. Depth and stencil testing are disabled. textureSizeX and textureSizeY are the width and height of the 3D texture.

Anyways my point is that layering is not done in three dimensions it is done after it is rastered onto the screen

Believe what you want.

I had this issue on 1.6, even 1.5 i think. I don't understand why it cant be fixed. Its just an opengl layer issue. The water is rendered at a higher layer than the particles, that is why the water renders on top, the particles do not get transparent, they are simply rendered under the water (the water is transparent thus letting only some of the visibility out)

This is also the same with the hit-box which is small to notice, but very unnatural and unrealistic. Just make sure the particles are above the clouds and water layers. This issue is almost a year old, and it is really annoying.

It would be very nice to see this fixed in the next snapshot. When Jeb took over that is when i noticed it. It never happened before, im assuming it may have changed when the new Shaders, and other render-able objects, Jeb must have accidentally mixed a layer.