Jump to content

Recommended Posts

Posted

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!

Posted

Any idea, do you need some code ? I looked into RenderSlime class, i really have to create a layer class or some OpenGL attributes can fix the problem in ModelBase#render ? Thanks in avance!

Posted

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/

Posted (edited)

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
Posted

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/

Posted

That's a bus, an entity rendered by an obj file. They were invisible behind the bus just before i decided to add the 4 attributes of my previous message. Do i need to modify something concerning them ?

  • 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.