Jump to content

Disappearing mobs behind my semi-transparent entity renderer


Plaigon

Recommended Posts

Hi guys, i'm encountering a problem concerning the renderer of my custom entity. It contains some glasses, which are perfectly rendered about tranparancy, but problem occurs when background entities are wandering behind it, they literally disappear, any ideas of fix ? My OpenGL attributes are GL_BLEND and (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA), do i need to enable/disable other ones ?

Thanks in advance!

Link to comment
Share on other sites

It depends on exactly what you mean by disappears. Do you mean a portion disappears (i.e. a blending issue), or the whole thing doesn't get rendered (a culling issue)? in other words do you think the entity behind is still trying to render but just isn't visible, or is not rendering because it believes it is behind something and doesn't need to be rendered?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

It sounds like a culling issue, by the fact that all entities wandering behind mine literally disappear. I'm pretty sure that occurs since they believe it's behind something of not transparent, and doesn't need to be visible on the screen. Have you got a fix, or a link to help me =) ? Thanks for your quick answer as well!

 

EDIT: Here's the result:

 1522012000-2018-03-25-23-06-07.png

When i'm using this attributes:

 

            glEnable(GL_CULL_FACE);

            glEnable(GL_DEPTH_TEST);
            glAlphaFunc(GL_GREATER, 0.1f);
            glDepthMask(true);

 

Edited by Plaigon
Link to comment
Share on other sites

Describe the picture a bit more. So this is the inside of a train or bus? Is the windows part of an entity or a structure?

 

In your picture I can't tell if something is disappearing, but instead it looks like the opposite -- some of the animals should be hidden by the floor and the frame of the windows but are rendering on top of it. 

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.