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

Hello.

 

I am trying to add fluid pipes with transparency.

I render my pipes in a TESR and tried to add the partly transparent fluids there too.
 

In a forum post about transparency and depth masks (https://relativity.net.au/gaming/java/Transparency.html) I read that the solution would be to:

> 1. Draw the entire scene with depth testing on for all the opaque fragments.

> 2. Draw the entire scene again with the depth buffer read only.

I implemented this for each TileEntity on its own, and they're working somewhat (see first attachment):

fdbagijuvadshgbhaiusdfhaiusdhfgahiousdghaisdfuhgasdioufh.jpg

However, when I'm facing eastwards, the block more far away from me gets entirely replaced by the one closer (see second attachment):

zzzzzzzzzz.jpg

This does not happen with any other block, I didn't test other TEs (see third attachment):

zzzzzzzzzzzzzzzzzzzzzzzzzzzzz.jpg

 

My code is in https://pastebin.com/ezS9RmZ9

 

I guess this happens because the TEs are rendered in the wrong order and because the depth mask is set to read only when the transparent water is drawn.

 

I think this could be drawn by collecting all TEs to render in the render() method and rendering them after I have got all collected in one global run (in the two steps specified above).

 

However, this would result in a huge performance overhead, if I'm not mistaken.

 

Can anybody else help me how I could fix or at least debug this?

Thanks for any help in advance :)

Guest
This topic is now closed to further replies.

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.