Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

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!

  • Author

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!

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/

  • Author

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

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/

  • Author

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

Fixed using Entity#shouldRenderInPass to render translucide part during pass number 1.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.